[backend/asp] Return trace identifier header even when no error has occurred
This commit is contained in:
parent
6e30b667b2
commit
29cbf5cb4b
1 changed files with 3 additions and 4 deletions
|
@ -26,6 +26,7 @@ public class ErrorHandlerMiddleware(
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
ctx.Response.Headers.RequestId = ctx.TraceIdentifier;
|
||||||
await next(ctx);
|
await next(ctx);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -77,7 +78,6 @@ public class ErrorHandlerMiddleware(
|
||||||
verbosity = ExceptionVerbosity.Basic;
|
verbosity = ExceptionVerbosity.Basic;
|
||||||
|
|
||||||
ctx.Response.StatusCode = (int)ce.StatusCode;
|
ctx.Response.StatusCode = (int)ce.StatusCode;
|
||||||
ctx.Response.Headers.RequestId = ctx.TraceIdentifier;
|
|
||||||
|
|
||||||
if (isMastodon)
|
if (isMastodon)
|
||||||
{
|
{
|
||||||
|
@ -119,7 +119,6 @@ public class ErrorHandlerMiddleware(
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ctx.Response.StatusCode = 500;
|
ctx.Response.StatusCode = 500;
|
||||||
ctx.Response.Headers.RequestId = ctx.TraceIdentifier;
|
|
||||||
|
|
||||||
var error = new ErrorResponse(e)
|
var error = new ErrorResponse(e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue