The following code uses capture_exception()
and doesn’t record the stack trace
def cause_exception():
try:
cause_exception = missing_func2() + 2
except Exception as error:
print(error)
capture_exception()
def doesnt_do_anything():
cause_exception()
if __name__ == "__main__":
sentry_sdk.init(
"https://xxxxx.ingest.sentry.io/yyyyy",
traces_sample_rate=1.0,
server_name="nickstest",
attach_stacktrace=True,
debug=True
)
doesnt_do_anything()
If however I don’t catch the exception and let the exception bubble to the top level then the stacktrace is captured. See screen shots:
Is there a way to use capture_exception()
to include the stacktrace in the report?