App: improve exception logging
This commit is contained in:
committed by
hsjobeki
parent
bdec967444
commit
c31907917d
@@ -125,7 +125,11 @@ class WebExecutor(GObject.Object):
|
|||||||
result = dataclass_to_dict(data.result)
|
result = dataclass_to_dict(data.result)
|
||||||
# Important:
|
# Important:
|
||||||
# 2. ensure_ascii = False. non-ASCII characters are correctly handled, instead of being escaped.
|
# 2. ensure_ascii = False. non-ASCII characters are correctly handled, instead of being escaped.
|
||||||
serialized = json.dumps(result, indent=4, ensure_ascii=False)
|
try:
|
||||||
|
serialized = json.dumps(result, indent=4, ensure_ascii=False)
|
||||||
|
except TypeError:
|
||||||
|
log.exception(f"Error serializing result for {data.method_name}")
|
||||||
|
raise
|
||||||
log.debug(f"Result for {data.method_name}: {serialized}")
|
log.debug(f"Result for {data.method_name}: {serialized}")
|
||||||
|
|
||||||
# Use idle_add to queue the response call to js on the main GTK thread
|
# Use idle_add to queue the response call to js on the main GTK thread
|
||||||
|
|||||||
Reference in New Issue
Block a user