2011-10-10 50 views
0

我嘗試忽略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配置: How to catch a specific HttpException (#0x80072746) in an IHttpHandler

有沒有人有想法?

非常感謝提前!

回答

0

那些不是您正在測試的HTTP狀態代碼,它們是ASP.Net錯誤代碼。 HTTP狀態代碼是三位數字,如404(未找到)或500(內部服務器錯誤)。要忽略類似指定的.Net錯誤,您可以嘗試使用正則表達式對以下錯誤消息進行匹配:

<errorFilter> 
    <test> 
    <regex binding="BaseException.Message" pattern="System.Web.HttpException (0x80072746)" /> 
    </test> 
</errorFilter>