Last active
July 20, 2017 04:06
-
-
Save scottsauber/f0252af3481a8bc6aaf4d2d02a992cb2 to your computer and use it in GitHub Desktop.
Environments
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
public void Configure(IApplicationBuilder app, IHostingEnvironment env) | |
{ | |
// if we're in Development | |
if (env.IsDevelopment()) | |
{ | |
// Show the Light Blue Screen of Death if there's an unhandled exception (RIP Yellow Screen of Death of ASP.NET 4) | |
app.UseDeveloperExceptionPage(); | |
} | |
else | |
{ | |
// In any other Environment redirect the user to /Home/Error if there's an unhandled exception | |
app.UseExceptionHandler("/Home/Error"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment