2

I have a global html error handler setup like this:

public override void Configure(Container container)
{
    //...
    this.GlobalHtmlErrorHttpHandler = new RazorHandler("/oops");

    this.ServiceExceptionHandlers.Add((httpReq, request, exception) =>
    {
        //Log the exception here...

        //return custom response
        return DtoUtils.CreateErrorResponse(request, exception, responseStatus);
    });
}

and the view code that displays error message - "oops.cshtml":

@inherits ViewPage<ErrorResponse>

@{
    ViewBag.Title = "Error";

    Layout = "~/Views/Shared/_NotLoggedLayout.cshtml";

    string errorMessage = "Test error message";

}  

<h2>Error Message: @errorMessage</h2>

When exception occurs, I can set a breakpoint inside the view code and step through with all the exepected "ErrorResponse" model passed to the view but I never see the page when I run it.

I checked the underlying html in Chrome and it just an empty page:

<html>
    <head>
    </head>
    <body>
    </body>
</html>

This used to work fine until I upgraded to Servicestack 5.0.* from 4.5.*.

Not sure what is going on.

Ermias Y
  • 263
  • 2
  • 11
  • 1
    Can upgrade to [v5.0.3 on MyGet](http://docs.servicestack.net/myget) and let me know if it’s still an issue? – mythz Mar 28 '18 at 22:43
  • 2
    It's working now with [v5.0.3](http://docs.servicestack.net/myget). Thank you for the quick response. – Ermias Y Mar 28 '18 at 23:13

0 Answers0