Skip to content
This repository was archived by the owner on Oct 4, 2024. It is now read-only.

Commit 876c658

Browse files
committed
Aggiunto esempio StatusCode 502 - Bad Gateway
1 parent c83c3fc commit 876c658

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/CustomLibrary.ProblemDetails.Sample/Controllers/TestController.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,4 +179,18 @@ public async Task<IActionResult> GetExceptionNotImplementedAsync()
179179
return ResponseException.NotImplemented(HttpContext, exc);
180180
}
181181
}
182+
183+
[HttpGet("BadGateway")]
184+
public async Task<IActionResult> GetExceptionBadGatewayAsync()
185+
{
186+
try
187+
{
188+
await Task.Delay(500);
189+
throw new Exception.BadGatewayException("Bad Gateway");
190+
}
191+
catch (Exception.BadGatewayException exc)
192+
{
193+
return ResponseException.BadGateway(HttpContext, exc);
194+
}
195+
}
182196
}

0 commit comments

Comments
 (0)