【发布时间】:2021-12-13 14:12:44
【问题描述】:
我有一个烧瓶应用程序,我在其中创建了一些自定义异常,我想最终基于这些异常创建警报。 现在,捕获异常有效,但堆栈跟踪没有跟随。
class SentryMailError(Exception):
"""Errors related to sending emails"""
def __init__(self, err):
super().__init__(err)
在X函数中,我希望能够运行:
from sentry_sdk import capture_exception
def randomfunc():
try:
division_by_zero = 1 / 0
except as err:
capture_exception(SentryMaiLError(err)) # no stack trace
capture_exception(err) # stack trace, but not able to use my custom error
并且仍然保留堆栈跟踪,但最终没有堆栈跟踪可用。 我做错了什么?
【问题讨论】: