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 want to control for which exceptions to log traceback and for which not.
For example, I want to only print nice one-line log for my custom exception (e.g. MyJobFailed(reason="DB connection error")) but keep printing tracebacks for all other exceptions (unhandled exceptions).
I know I can use try..except and re-raise all exceptions except MyJobFailed, but this way my job would be logged as "succeed", but I want it to be logged as "failed"
The text was updated successfully, but these errors were encountered:
I want to control for which exceptions to log traceback and for which not.
For example, I want to only print nice one-line log for my custom exception (e.g.
MyJobFailed(reason="DB connection error")
) but keep printing tracebacks for all other exceptions (unhandled exceptions).I know I can use
try..except
and re-raise all exceptions exceptMyJobFailed
, but this way my job would be logged as "succeed", but I want it to be logged as "failed"The text was updated successfully, but these errors were encountered: