Skip to content

Instantly share code, notes, and snippets.

@scottsauber
Last active July 20, 2017 04:06
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 scottsauber/f0252af3481a8bc6aaf4d2d02a992cb2 to your computer and use it in GitHub Desktop.
Save scottsauber/f0252af3481a8bc6aaf4d2d02a992cb2 to your computer and use it in GitHub Desktop.
Environments
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