fix(error): don't return in a finally block (PEP-765) (#35610)
https://docs.python.org/3/whatsnew/3.14.html#pep-765-control-flow-in-finally-blocks Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
489f5fbfb9
commit
f8443020ca
1 changed files with 3 additions and 2 deletions
|
|
@ -109,9 +109,10 @@ def get_error_metadata() -> str:
|
|||
metadata["form_dict"] = sanitized_dict(frappe.form_dict)
|
||||
|
||||
metadata["user"] = getattr(frappe.session, "user", "Unidentified")
|
||||
finally:
|
||||
except Exception:
|
||||
# We don't want to bother with exception handling *while* gathering some error's metadata
|
||||
return frappe.as_json(metadata) # noqa: B012
|
||||
pass
|
||||
return frappe.as_json(metadata)
|
||||
|
||||
|
||||
def log_error_snapshot(exception: Exception):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue