-
Notifications
You must be signed in to change notification settings - Fork 1
HandleError not hit #2
Copy link
Copy link
Open
Description
As stated in https://github.com/bernos/Nancy.CustomErrors, I've overriden handleerror but somehow it's not hit (have put a breakpoint there)
public class ErrorConfiguration : CustomErrorsConfiguration
{
public ErrorConfiguration()
{
// Map error status codes to custom view names
ErrorViews[HttpStatusCode.NotFound] = "error";
ErrorViews[HttpStatusCode.InternalServerError] = "error";
ErrorViews[HttpStatusCode.Forbidden] = "error";
}
public override ErrorResponse HandleError(NancyContext context, Exception ex, ISerializer serializer)
{
var error = new Error
{
FullException = ex.ToString(),
Message = ex.Message
};
return new ErrorResponse(error, serializer).WithStatusCode(HttpStatusCode.InternalServerError) as ErrorResponse;
}
}
protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
{
CustomErrors.Enable(pipelines, new ErrorConfiguration());
}any ideas?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels