ignoring all similar errors

Baris

Posted on
Jul 30 2016

I need to permanently ignore all 404 errors for a project, some bots are constantly trying non-existent pages in my system and I'm bored of receiving errors for that.

Any ideas how I can do this?


Callum

Posted on
Aug 01 2016

Hi Baris,

You have a few options here, these depend on which .NET subframework you're using and whether you want to ignore these declaratively or programatically. The easiest approach may be to use the excludeHttpStatusCode attribute, for instance with ASP.NET MVC in your web.config:

<RaygunSettings apikey="YOUR_APP_API_KEY" excludeHttpStatusCodes="404" />

This is documented at https://raygun.com/docs/languages/net/mvc#exclude-status-code.

Similar functions are also available for ASP.NET, WebApi, .NET Core etc, and there's also the SendingMessage event which you can set a delegate which can cancel a pending message based on some data. Documentation is available for these at https://raygun.com/docs/languages/net.

Regards,

Callum Gavin
Raygun Limited


Reply