Skip to content

Instantly share code, notes, and snippets.

@vgerbase
Last active August 6, 2017 14:49
Show Gist options
  • Save vgerbase/e7d31dfbf51e174d0d65 to your computer and use it in GitHub Desktop.
Save vgerbase/e7d31dfbf51e174d0d65 to your computer and use it in GitHub Desktop.
Elmah Error Filter
<!-- EN-US -->
<errorFilter>
<test>
<or>
<equal binding="HttpStatusCode" value="404" type="Int32" />
<regex binding="Context.Request.ServerVariables['URL']" pattern="/favicon\.ico(\z|\?)" />
</or>
<or>
<and>
<!-- O arquivo '/[^']+' não existe -->
<regex binding="BaseException.Message" pattern="The file '/[^']+' does not exist" />
<regex binding="FilterSourceType.Name" pattern="mail" />
</and>
<and>
<!-- O controlador do caminho '/[^']+' não foi encontrado ou não implementa IController. -->
<regex binding="Exception" type="System.Web.HttpException" pattern="The controller for path '/[^']+' was not found or does not implement IController." />
<regex binding="FilterSourceType.Name" pattern="mail" />
</and>
</or>
</test>
</errorFilter>
<!-- PT-BR -->
<errorFilter>
<test>
<or>
<equal binding="HttpStatusCode" value="404" type="Int32" />
<regex binding="Context.Request.ServerVariables['URL']" pattern="/favicon\.ico(\z|\?)" />
</or>
<or>
<and>
<!-- The file '/[^']+' does not exist -->
<regex binding="BaseException.Message" pattern="O arquivo '/[^']+' não existe" />
<regex binding="FilterSourceType.Name" pattern="mail" />
</and>
<and>
<!-- The controller for path '/[^']+' was not found or does not implement IController. -->
<regex binding="Exception" type="System.Web.HttpException" pattern="O controlador do caminho '/[^']+' não foi encontrado ou não implementa IController." />
<regex binding="FilterSourceType.Name" pattern="mail" />
</and>
</or>
</test>
</errorFilter>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment