Closed daghemo closed 6 years ago
I'd like to know this too. Just started using Sentry, and thought this was exactly the point of it, to catch unhandled exceptions in stock Python so that devs didn't have to go hunting through logs.
A big fat except:
seems heavyhanded.
By default, we instrument sys.excepthook
once you initialize a Client
object. In which case, then completely uncaught exceptions would be recorded.
Ah, very nice! I kinda hoped so, it just isn't super clear in the doco. Not sure if that is able to be contributed to or not? Otherwise, perhaps a suggestion for it to be added ;)
Tested and confirmed. Maybe some more sleep needed here: I was convinced I had already tried!
The new SDK handles this out of the box automatically. Have a look at sentry-python.
Hi there, is there any option to catch unhandled exceptions from within a Python program (no Flask/Django)?
I can do this in Azure Application Insights as follows:
The above code would report a ZeroDivisionError exeception to the Azure Application Insights console.
Regards, Danilo