Sebastian Nemeth
Sebastian Nemeth

Reputation: 6165

Is there a YSOD in ServiceStack for Unhandled Exceptions?

Is there a built-in renderer for unhandled exceptions when using the RazorFormat plugin?

Our service is throwing an exception, but ServiceStack is rendering the corresponding Razor view anyway (just with empty data). I would have expected Razor to pick up the error in the ResponseStatus property and display something like ASP.Net's YSOD.

Edit: Our DebugMode on HostConfig is set to 'true'.

Upvotes: 3

Views: 56

Answers (1)

mythz
mythz

Reputation: 143284

See this previous answer on getting Error Info from a Razor Page, e.g. You can short-cut your page to just display the Error message with:

@if (RenderErrorIfAny()) { return; }

You can also specify a custom fallback Razor Page for different Errors.

Upvotes: 2

Related Questions