Created
February 15, 2018 08:04
-
-
Save HamidMosalla/ddafc6ba5df5cdc0bf2a62e13664a9b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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