-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log the exception if bot fails #74
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, doesn't work for me - I raised a ValueError somewhere in the code, but the output just said:
2022-12-30T22:10:30.773533816Z 0.01 [events-bot] DC_EVENT_INFO data1=0 data2=src/scheduler.rs:324: starting smtp loop
2022-12-30T22:10:30.773821563Z 0.01 [events-bot] DC_EVENT_INFO data1=0 data2=src/scheduler.rs:517: scheduler is running
2022-12-30T22:10:30.774288545Z 0.01 [events-bot] DC_EVENT_INFO data1=0 data2=src/location.rs:603: Location loop is waiting for 24h 0m 0s or interrupt
2022-12-30T22:10:30.777363951Z bot received an unexpected error , exiting now
2022-12-30T22:10:30.777424861Z 0.01 [events-bot] DC_EVENT_INFO data1=0 data2=src/ephemeral.rs:544: Ephemeral loop waiting for deletion in 24h 0m 0s or interrupt
@missytake I pushed another commit to format with repr(), so it also prints the error class. But otherwise it's ok that
|
Hm, that's a bit better, but can't we log the whole stacktrace? Without the stacktrace it's not very useful. |
What about this:
|
I did it with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now! We could aaaalso make a finally
out of it again instead of except
, then my IDE doesn't complain about the "too broad exception clause" ;) but except fits as well.
Exception is probably not accessible from the |
63aafc3
to
2a46688
Compare
It doesn't, if only because there is a |
No description provided.