Merge pull request #3897 from abpframework/maliming/patch-3

Add error page in template projects.
pull/3918/head
Halil İbrahim Kalkan 5 years ago committed by GitHub
commit 73cde6712b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -15,6 +15,7 @@ using Microsoft.OpenApi.Models;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Autofac;
using Volo.Abp.Caching;
@ -162,6 +163,16 @@ namespace MyCompanyName.MyProjectName
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseErrorPage();
}
app.UseCorrelationId();
app.UseVirtualFiles();

@ -213,8 +213,6 @@ namespace MyCompanyName.MyProjectName.Web
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
app.UseCorrelationId();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
@ -224,6 +222,7 @@ namespace MyCompanyName.MyProjectName.Web
app.UseErrorPage();
}
app.UseCorrelationId();
app.UseVirtualFiles();
app.UseRouting();
app.UseAuthentication();

@ -192,8 +192,6 @@ namespace MyCompanyName.MyProjectName.Web
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
app.UseCorrelationId();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
@ -202,6 +200,8 @@ namespace MyCompanyName.MyProjectName.Web
{
app.UseErrorPage();
}
app.UseCorrelationId();
app.UseVirtualFiles();
app.UseRouting();
app.UseAuthentication();

@ -15,6 +15,7 @@ using Swashbuckle.AspNetCore.Swagger;
using Volo.Abp;
using Volo.Abp.AspNetCore.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.Autofac;
@ -147,11 +148,18 @@ namespace MyCompanyName.MyProjectName
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
if (!context.GetEnvironment().IsDevelopment())
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseErrorPage();
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseCorrelationId();
app.UseVirtualFiles();

@ -17,6 +17,7 @@ using Volo.Abp.AspNetCore.Authentication.JwtBearer;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Auditing;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
@ -168,11 +169,18 @@ namespace MyCompanyName.MyProjectName
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
if (!context.GetEnvironment().IsDevelopment())
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseErrorPage();
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseCorrelationId();
app.UseVirtualFiles();

@ -112,8 +112,9 @@ namespace MyCompanyName.MyProjectName
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
if (context.GetEnvironment().IsDevelopment())
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}

Loading…
Cancel
Save