ready for arvan

release
Amir Hossein Khademi 2024-03-10 09:51:57 +03:30
parent 7aa057cd8c
commit 54312efb3b
4 changed files with 20 additions and 5 deletions

View File

@ -1 +1 @@
0.17.20.32
0.17.20.33

View File

@ -24,6 +24,21 @@ public class SeedController : ICarterModule
.WithDisplayName("SeedCategoriesAsync")
.HasApiVersion(1.0);
group.MapGet("test3", () =>
{
return TypedResults.Problem("Server Error 2 ( EXCEPTION THROWN )");
})
.WithDisplayName("SeedCategoriesAsync")
.HasApiVersion(1.0);
group.MapGet("test3", () =>
{
return TypedResults.StatusCode(500);
})
.WithDisplayName("SeedCategoriesAsync")
.HasApiVersion(1.0);
//group.MapPost("categories", SeedCategoriesAsync)
// .WithDisplayName("SeedCategoriesAsync")
// .HasApiVersion(1.0);

View File

@ -6,8 +6,8 @@
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<AssemblyVersion>0.17.20.32</AssemblyVersion>
<FileVersion>0.17.20.32</FileVersion>
<AssemblyVersion>0.17.20.33</AssemblyVersion>
<FileVersion>0.17.20.33</FileVersion>
</PropertyGroup>
<ItemGroup>

View File

@ -145,7 +145,7 @@ public class ExceptionHandlerMiddleware
Formatting = Formatting.Indented
});
context.Response.StatusCode = (int)HttpStatusCode.InternalServerError;
context.Response.StatusCode = 501;
context.Response.ContentType = "application/json";
await context.Response.WriteAsJsonAsync(result);
}
@ -171,7 +171,7 @@ public class ExceptionHandlerMiddleware
Formatting = Formatting.Indented
});
context.Response.StatusCode = (int)httpStatusCode;
context.Response.StatusCode = 501;
context.Response.ContentType = "application/json";
await context.Response.WriteAsJsonAsync(result);
}