feliperochadev / elmah

Automatically exported from code.google.com/p/elmah
Apache License 2.0
0 stars 0 forks source link

Error filtering assertiong is-type does not work properly #52

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In your beta2 version, I can confirm something someone posted to the 
groups.

This will NOT filter the exception:
        <errorFilter>
            <test>
                <is-type binding="BaseException" 
value="System.Security.Cryptography.CryptographicException" />
            </test>
        </errorFilter>

and this WILL filter the exception:
void ErrorLog_Filtering(object sender, Elmah.ExceptionFilterEventArgs 
e)     
{
    if (e.Exception.GetBaseException() is 
System.Security.Cryptography.CryptographicException)   
        e.Dismiss();   
}   

To test, just throw an exception from a web application like:
        throw new System.Security.Cryptography.CryptographicException
("Padding is invalid and cannot be removed");

Original issue reported on code.google.com by wayne.br...@gmail.com on 31 Jan 2008 at 2:26

GoogleCodeExporter commented 9 years ago
I setup a test to check this issue. See the attached solution for a complete 
example. It seems that you have a typo in your configuration. The attribute 
that 
specifies the type for the <is-test> element and assertion is called "type" and 
not "value". In other words, instead of:

<is-type binding="BaseException" 
value="System.Security.Cryptography.CryptographicException" />

It should read:

<is-type binding="BaseException" 
type="System.Security.Cryptography.CryptographicException" />

You should be able to verify this through the attached solution.

I've changed the status to Invalid for now until proven otherwise.

Original comment by azizatif on 31 Jan 2008 at 9:03

Attachments: