NickCraver / StackExchange.Exceptional

Error handler used for the Stack Exchange network
https://nickcraver.com/StackExchange.Exceptional/
Apache License 2.0
859 stars 170 forks source link

System.Web.HttpException Logged, but missing data #147

Open seankearney opened 5 years ago

seankearney commented 5 years ago

Requests such as /test<illegal.jpg throw a System.Web.HttpException exception

[HttpException (0x80004005): A potentially dangerous Request.Path value was detected from the client (*).]
   System.Web.HttpRequest.ValidateInputIfRequiredByConfig() +9939972
   System.Web.PipelineStepManager.ValidateHelper(HttpContext context) +53

Exceptional does catch these exceptions, but it is lacking information such as the actual Url. We can trace this down to https://github.com/NickCraver/StackExchange.Exceptional/blob/master/src/StackExchange.Exceptional/AspNetExtensions.cs#L145 where in this case the context.Handler == null.

image

NickCraver commented 5 years ago

The context.Handle == null check (proposed to remove in #148) causes other null refs on startup...but I'll have to find what those were.

We need a bit more info here to more finitely localize the null checks and get as much info as possible instead of bailing completely. I'll try and look back, but not sure I have the exact cause that https://github.com/NickCraver/StackExchange.Exceptional/commit/2fad0bc3fac2d121a58a6a870a2609f85b360ae3 resolved.