You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I prefer to log unexpected exception (that is converted to RPCInternalError) as error with traceback.
(Or add some settings value so that it can be configured to be logged as error)
Otherwise I must wrap all my RPC-functions by my own wrapper to be error logged:
@rpc_method
def divide(a, b):
try:
return a / b
except RPCException:
raise
except Exception as exc:
logging.exception(f"RPCInternalError: {exc}")
raise RPCInternalError(str(exc)) from exc
Or configuration parameter for custom error handler can be added.
Developer can report unexpected exceptions also to other system like Sentry-SDK etc... in this case.
I prefer to log unexpected exception (that is converted to RPCInternalError) as error with traceback.
(Or add some settings value so that it can be configured to be logged as error)
Otherwise I must wrap all my RPC-functions by my own wrapper to be error logged:
Because "default exception handler" does not log errors, but warnings in this case
https://github.com/alorence/django-modern-rpc/blob/main/modernrpc/core.py#L149C9-L151C54
The text was updated successfully, but these errors were encountered: