Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
r686 committed - Linked TypeCode in ErrorFiltering wiki.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
codesite-nore...@google.com  
View profile  
 More options Oct 13, 1:44 pm
From: codesite-nore...@google.com
Date: Tue, 13 Oct 2009 17:44:47 +0000
Local: Tues, Oct 13 2009 1:44 pm
Subject: [elmah] r686 committed - Linked TypeCode in ErrorFiltering wiki.
Revision: 686
Author: azizatif
Date: Tue Oct 13 10:44:18 2009
Log: Linked TypeCode in ErrorFiltering wiki.

http://code.google.com/p/elmah/source/detail?r=686

Modified:
  /wiki/ErrorFiltering.wiki

=======================================
--- /wiki/ErrorFiltering.wiki   Mon Aug 17 13:03:10 2009
+++ /wiki/ErrorFiltering.wiki   Tue Oct 13 10:44:18 2009
@@ -106,7 +106,7 @@
  </elmah>
  }}}

-In the above example, there is a single _assertion_ that will be true when  
the `HttpStatusCode` _equals_ the integer value `404`. There are a lot of  
components at work here so let's dissect this a bit more. ELMAH comes with  
a number of built-in assertions and you can even add your own. The most  
interesting of the assertions test their environment or context for a  
condition. If the condition is met, the assertion outcome is _true_. The  
_context_ is usually the exception that is being raised and the HTTP  
transaction running its course. Both of these are available to the handler  
of the `Filtering` event as properties of the `ExceptionFilterEventArgs`.  
The `ErrorFilterModule` takes these two and adds a few more helper  
properties that are subsequently available as the total context for all  
assertions. The `<equal>` assertion above has a `binding` attribute that is  
actually a data-binding expression that you already know. It is the very  
same expression and syntax you specify to the `Eval` method when  
data-binding within the server-side markup of ASP.NET pages and user  
controls. This expression is evaluated against the context so naturally  
`HttpStatusCode` is a property of the context. The assertion evaluates the  
expression and uses the resulting value to compare against the literal  
given in the `value` attribute. To compare apples to apples and oranges to  
oranges, you have to specify the type of the value expected from the  
binding expression as well as that of the text in the `value` attribute.  
That is the purpose of the `type` attribute, which can be one of the  
`TypeCode` enumeration members. Consequently, the current set of  
_comparison assertions_ are limited to primitive types represented by the  
`TypeCode` members (except `Empty`, `DBNull` and `Object`). This may seem  
limiting at first but it will suffice the majority of filtering you will  
need. For exotic cases, you can always write your own assertions. If you  
omit the `type` attribute then the value type of `String` is assumed.  
Finally, if the comparison succeeds, the assertion flags true and the  
exception is eventually dismissed. With this explanation in mind, here is a  
quick recap of what happens in the above example. First `HttpStatusCode` is  
evaluated against the filter context. Its result is converted to a 32-bit  
integer and compared against the value 404. If they equal, the assertion  
tells the the `ErrorFilterModule` that the exception matches the condition  
for dismissal.
+In the above example, there is a single _assertion_ that will be true when  
the `HttpStatusCode` _equals_ the integer value `404`. There are a lot of  
components at work here so let's dissect this a bit more. ELMAH comes with  
a number of built-in assertions and you can even add your own. The most  
interesting of the assertions test their environment or context for a  
condition. If the condition is met, the assertion outcome is _true_. The  
_context_ is usually the exception that is being raised and the HTTP  
transaction running its course. Both of these are available to the handler  
of the `Filtering` event as properties of the `ExceptionFilterEventArgs`.  
The `ErrorFilterModule` takes these two and adds a few more helper  
properties that are subsequently available as the total context for all  
assertions. The `<equal>` assertion above has a `binding` attribute that is  
actually a data-binding expression that you already know. It is the very  
same expression and syntax you specify to the `Eval` method when  
data-binding within the server-side markup of ASP.NET pages and user  
controls. This expression is evaluated against the context so naturally  
`HttpStatusCode` is a property of the context. The assertion evaluates the  
expression and uses the resulting value to compare against the literal  
given in the `value` attribute. To compare apples to apples and oranges to  
oranges, you have to specify the type of the value expected from the  
binding expression as well as that of the text in the `value` attribute.  
That is the purpose of the `type` attribute, which can be one of the  
<tt>[http://msdn.microsoft.com/en-us/library/system.typecode.aspx  
TypeCode]</tt> enumeration members. Consequently, the current set of  
_comparison assertions_ are limited to primitive types represented by the  
`TypeCode` members (except `Empty`, `DBNull` and `Object`). This may seem  
limiting at first but it will suffice the majority of filtering you will  
need. For exotic cases, you can always write your own assertions. If you  
omit the `type` attribute then the value type of `String` is assumed.  
Finally, if the comparison succeeds, the assertion flags true and the  
exception is eventually dismissed. With this explanation in mind, here is a  
quick recap of what happens in the above example. First `HttpStatusCode` is  
evaluated against the filter context. Its result is converted to a 32-bit  
integer and compared against the value 404. If they equal, the assertion  
tells the the `ErrorFilterModule` that the exception matches the condition  
for dismissal.

  As mentioned earlier, ELMAH ships with several built-in assertions and you  
can use them together to create complex conditions. For example, here the  
`<and>`, `<greater>` and `<lesser>` assertions are used together to filter  
all exceptions where the HTTP status code for the response falls in the  
integer range 400 to 499 (inclusive).


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google