Bottle 框架中错误的电子邮件追溯

发布于 2024-09-11 14:29:58 字数 124 浏览 2 评论 0原文

我正在使用 Bottle 框架。我已经设置了 @error 装饰器,这样我就可以显示我的自定义错误页面,并且如果发生任何 500 错误,我也可以发送电子邮件,但我需要在电子邮件中发送完整的回溯。有谁知道如何让框架将其包含在电子邮件中?

I am using the Bottle framework. I have set the @error decorator so I am able to display my customized error page, and i can also send email if any 500 error occurs, but I need the complete traceback to be sent in the email. Does anyone know how to have the framework include that in the e-mail?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

空袭的梦i 2024-09-18 14:29:58

在 @error 装饰器之后编写的 error500 函数中,为我的自定义错误页面提供服务,编写了 error.exceptionerror.traceback,这两个给出了异常和完整的回溯错误信息。

in the error500 function written after the @error decorator to serve my customized error page, wrote error.exception and error.traceback, these two give the exception and complete traceback of the error message.

穿越时光隧道 2024-09-18 14:29:58

调试模式启用完整的回溯:

from bottle import debug
debug(True)

从那里,您需要将 stderr 通过管道传输到文件,然后发送它。

Debugging mode enables full tracebacks:

from bottle import debug
debug(True)

From there, you will need to pipe stderr to a file, then send it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文