Skip to content

Instantly share code, notes, and snippets.

@HamidMosalla
Created February 15, 2018 08:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HamidMosalla/ddafc6ba5df5cdc0bf2a62e13664a9b3 to your computer and use it in GitHub Desktop.
Save HamidMosalla/ddafc6ba5df5cdc0bf2a62e13664a9b3 to your computer and use it in GitHub Desktop.
var path = context.Response.HttpContext.Request.Path;
if (path.HasValue && path.Value.Contains("api"))
{
context.Response.StatusCode = 500;
await context.Response.WriteAsync("An unexpected fault happened. Try again later.");
return;
}
context.Response.Redirect($"/Error/Status/{context.Response.StatusCode}");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment