File tree Expand file tree Collapse file tree 4 files changed +17
-7
lines changed Expand file tree Collapse file tree 4 files changed +17
-7
lines changed Original file line number Diff line number Diff line change 44 </Folder >
55 <Folder Name =" /solution/" >
66 <File Path =" .editorconfig" />
7+ <File Path =" build-pack.sh" />
78 <File Path =" Directory.Build.props" />
89 <File Path =" Directory.Packages.props" />
910 </Folder >
1516 <Folder Name =" /src/" >
1617 <Project Path =" src\RestExceptions\RestExceptions.csproj" Type =" Classic C#" />
1718 </Folder >
18- </Solution >
19+ </Solution >
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+
4+ cd ./src/RestExceptions
5+ dotnet clean
6+ dotnet build -c Release
7+ dotnet pack -c Release
8+
9+ # To run:
10+ # chmod +x build-pack.sh
Original file line number Diff line number Diff line change @@ -23,12 +23,11 @@ public static IServiceCollection AddRestExceptions(this IServiceCollection servi
2323 {
2424 options . CustomizeProblemDetails = context =>
2525 {
26- context . ProblemDetails . Instance =
27- $ "[ { context . HttpContext . Request . Method } ] { context . HttpContext . Request . Path } " ;
26+ context . ProblemDetails . Instance = context . HttpContext . Request . Path ;
27+ context . ProblemDetails . Extensions . Add ( "method" , context . HttpContext . Request . Method ) ;
2828 context . ProblemDetails . Extensions . Add ( "requestId" , context . HttpContext . TraceIdentifier ) ;
29-
30- var activity = context . HttpContext . Features . Get < IHttpActivityFeature > ( ) ? . Activity ;
31- context . ProblemDetails . Extensions . TryAdd ( "traceId" , activity ? . Id ) ;
29+ context . ProblemDetails . Extensions . TryAdd ( "traceId" ,
30+ context . HttpContext . Features . Get < IHttpActivityFeature > ( ) ? . Activity . Id ) ;
3231 } ;
3332 } ) ;
3433 services . AddExceptionHandler < RestExceptionHandler > ( ) ;
Original file line number Diff line number Diff line change 33 <PackageId >RestExceptions</PackageId >
44 <Title >RestExceptions</Title >
55 <Description >Extensible Web API middleware that maps all exceptions to standardized REST-compliant error responses.</Description >
6- <Version >9.0.7.1 </Version >
6+ <Version >9.0.7.2 </Version >
77 <TargetFramework >net9.0</TargetFramework >
88
99 <Authors >Stratis-Dermanoutsos</Authors >
You can’t perform that action at this time.
0 commit comments