clan-app: Move json.loads to try catch
This commit is contained in:
@@ -43,10 +43,11 @@ class WebviewBridge(ApiBridge):
|
||||
arg: int,
|
||||
) -> None:
|
||||
"""Handle a call from webview's JavaScript bridge."""
|
||||
|
||||
try:
|
||||
op_key = op_key_bytes.decode()
|
||||
raw_args = json.loads(request_data.decode())
|
||||
|
||||
try:
|
||||
# Parse the webview-specific request format
|
||||
header = {}
|
||||
args = {}
|
||||
@@ -74,6 +75,8 @@ class WebviewBridge(ApiBridge):
|
||||
)
|
||||
|
||||
except Exception as e:
|
||||
msg = f"Error while handling webview call {method_name} with op_key {op_key_bytes}"
|
||||
log.exception(msg)
|
||||
self.send_error_response(op_key, str(e), ["webview_bridge", method_name])
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user