Skip to content

Commit

Permalink
Merge pull request #158 from SkillsFundingAgency/CON-2886-service-una…
Browse files Browse the repository at this point in the history
…vailable

CON-2886
  • Loading branch information
narendranogothu authored Jan 5, 2021
2 parents e7212de + d208708 commit 21753ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void ConfigureContainer(Registry registry)

public void Configure(IApplicationBuilder app)
{
app.UseDasErrorPages()
app.UseDasErrorPages(Environment)
.UseUnauthorizedAccessExceptionHandler()
.UseHttpsRedirection()
.UseDasHsts()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;

namespace SFA.DAS.EmployerCommitmentsV2.Web.Startup
{
public static class ErrorPagesStartup
{
public static IApplicationBuilder UseDasErrorPages(this IApplicationBuilder app)
public static IApplicationBuilder UseDasErrorPages(this IApplicationBuilder app, IHostingEnvironment environment)
{
var hostingEnvironment = app.ApplicationServices.GetService<IHostingEnvironment>();

if (hostingEnvironment.IsDevelopment())
if (environment.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/error")
.UseStatusCodePagesWithReExecute("/error", "?statuscode={0}");
app.UseExceptionHandler("/error");
app.UseStatusCodePagesWithRedirects("~/error/?statuscode={0}");
}

return app;
Expand Down

0 comments on commit 21753ea

Please sign in to comment.