WebApi RaygunWebApiActionFilter usage
drdimwit
Posted on
Apr 14 2015
In my API controller I want to be able to return a HttpResponseMessage with a HttpStatusCode of BadRequest. Along with this bad request I would also like to add set of custom data to the exception created explaining the bad request. This seems reasonable but as soon as I return the HttpResponseMessage the action filter picks up the OnActionExecuted and because there is not a exception on the HttpActionExecutedContext there a new RaygunWebApiHttpException created to which I have no chance to add the custom data to it.
It seems that if the HttpActionExecutedContext had an exception on it then the OnActionExecuted would just ignore the error and throw it up to the ExceptionLogger.
I am confused on how to proceed can someone provide an example please.
Thanks DD
drdimwit
Posted on
Apr 15 2015
This should probably be in the general discussion. Bumping to that channel.