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?
As stated in https://github.com/bernos/Nancy.CustomErrors, I've overriden handleerror but somehow it's not hit (have put a breakpoint there)
any ideas?