clan-app: decode function arguments ahead of launching a thread.
If something goew wrong here we rather want to crash the app and get bug reports.
This commit is contained in:
@@ -68,12 +68,9 @@ class Webview:
|
||||
arg: int,
|
||||
) -> None:
|
||||
op_key = op_key_bytes.decode()
|
||||
|
||||
def thread_task(stop_event: threading.Event) -> None:
|
||||
try:
|
||||
args = json.loads(request_data.decode())
|
||||
|
||||
log.debug(f"Calling {method_name}({args[0]})")
|
||||
|
||||
# Initialize dataclasses from the payload
|
||||
reconciled_arguments = {}
|
||||
for k, v in args[0].items():
|
||||
@@ -91,6 +88,8 @@ class Webview:
|
||||
# TODO: We could remove the wrapper in the MethodRegistry
|
||||
# and just call the method directly
|
||||
|
||||
def thread_task(stop_event: threading.Event) -> None:
|
||||
try:
|
||||
set_should_cancel(lambda: stop_event.is_set())
|
||||
result = wrap_method(**reconciled_arguments)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user