Compare commits

...
2 Commits
Author SHA1 Message Date
xrain 8c7f4ac12f add 3.1 support 2021-05-29 11:41:03 +08:00
xrain 856c70d4ac exceptionMiddleware now capture statusCode != 200 response 2021-05-29 11:33:30 +08:00
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -32,6 +32,10 @@ namespace SimApi.Middlewares
try
{
await Next(context);
if (context.Response.StatusCode != 200)
{
throw new SimApiException(context.Response.StatusCode);
}
}
catch (SimApiException ex)
{
@@ -43,6 +47,7 @@ namespace SimApi.Middlewares
{
response.SetCodeMsg(ex.Code, ex.Message);
}
ErrorResponse(context, response);
}
catch (Exception ex)
+1 -1
View File
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp5.0</TargetFramework>
<OutputType>Library</OutputType>
<PackOnBuild>true</PackOnBuild>
<Version>0.2.3</Version>
@@ -15,6 +14,7 @@
<SynchReleaseVersion>false</SynchReleaseVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageVersion>5.0.2</PackageVersion>
<TargetFrameworks>net5.0;netcoreapp3.1</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(RunConfiguration)' == 'YYApi' " />