There is a controller method

[DeflateCompression] [Route("Current/{count}")] public HttpResponseMessage GetCurrent(int count) { return someting here } 

And he is never called. Its implementation ExceptionFilterAttribute is attached to the controller, but is not called. Client receives 500 error without details. Other controllers are called without errors.

How to catch exception?

UPD: added code for referenced filter

 public class LoggingExceptionFilterAttribute : ExceptionFilterAttribute { public LoggingExceptionFilterAttribute(){} public override void OnException(HttpActionExecutedContext context) { var trackingId = context.Request.Headers.Contains(HeaderNames.TrackingHeader) ? context.Request.Headers.GetValues(HeaderNames.TrackingHeader).First() : Guid.NewGuid().ToString(); if (context.Exception is NotImplementedException) { context.Response = new HttpResponseMessage(HttpStatusCode.NotImplemented); } else { context.Response = context.Request.CreateResponse(HttpStatusCode.InternalServerError, ErrorResponse.Create(context.Exception, trackingId)); } } } 
  • Can you see the "insides" of a custom attribute? - gromanev
  • added a question - Anton Shakalo
  • LoggingExceptionFilterAttribute is this DeflateCompression? If so, then the entire code of the OnException method in the try is zvernite, and try to see what happens there for the exception pops up. If there will be no exceptions - let us know, we will think further =) - gromanev

0