Elmah 忽略 System.Web.HttpException (0x80072746)
我尝试忽略 Elmah 中的 System.Web.HttpException (0x80072746)。我尝试了以下方法,但它们不起作用:
<errorFilter>
<test>
<equal binding="HttpStatusCode" value="0x80072746" type="UInt32" />
</test>
</errorFilter>
并且
<errorFilter>
<test>
<equal binding="HttpStatusCode" value="0x80072746" type="Int32" />
</test>
</errorFilter>
我
<errorFilter>
<test>
<equal binding="HttpStatusCode" value="0x80072746" type="String" />
</test>
</errorFilter>
找到了这个线程,但它告诉我要投射它...我不知道如何在 Elmah Config 中投射它: 如何捕获特定的 HttpException (#0x80072746) IHttpHandler
有人有想法吗?
非常感谢!
I try to ignore the System.Web.HttpException (0x80072746) in Elmah. I tried the following, but they don't work:
<errorFilter>
<test>
<equal binding="HttpStatusCode" value="0x80072746" type="UInt32" />
</test>
</errorFilter>
and
<errorFilter>
<test>
<equal binding="HttpStatusCode" value="0x80072746" type="Int32" />
</test>
</errorFilter>
and
<errorFilter>
<test>
<equal binding="HttpStatusCode" value="0x80072746" type="String" />
</test>
</errorFilter>
I've found this thread, but it tells me to cast it... I don't know how to cast it in Elmah Config:
How to catch a specific HttpException (#0x80072746) in an IHttpHandler
Does anyone has a idea?
Many thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这些不是您正在测试的 HTTP 状态代码,它们是 ASP.Net 错误代码。 HTTP 状态代码是三位数字,例如 404(未找到)或 500(内部服务器错误)。要忽略指定的 .Net 错误,您可以尝试对错误消息使用 RegEx 进行匹配,如下所示:
Those are not HTTP status codes you're testing for, they're ASP.Net Error codes. HTTP Status codes are three digits like 404 (Not Found) or 500 (Internal Server Error). To ignore .Net errors like those specified, you could try a match using RegEx on the error message like below: