This repository was archived by the owner on Oct 4, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed
src/CustomLibrary.ProblemDetails.Sample/Controllers Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ public async Task<IActionResult> GetExceptionInternalServerErrorAsync()
163163 }
164164 }
165165
166- [ HttpGet ( "NotImplemented" ) ]
166+ [ HttpGet ( "NotImplemented-Exception " ) ]
167167 public async Task < IActionResult > GetExceptionNotImplementedAsync ( )
168168 {
169169 try
@@ -177,7 +177,7 @@ public async Task<IActionResult> GetExceptionNotImplementedAsync()
177177 }
178178 }
179179
180- [ HttpGet ( "BadGateway" ) ]
180+ [ HttpGet ( "BadGateway-Exception " ) ]
181181 public async Task < IActionResult > GetExceptionBadGatewayAsync ( )
182182 {
183183 try
@@ -191,7 +191,7 @@ public async Task<IActionResult> GetExceptionBadGatewayAsync()
191191 }
192192 }
193193
194- [ HttpGet ( "ServiceUnavailable" ) ]
194+ [ HttpGet ( "ServiceUnavailable-Exception " ) ]
195195 public async Task < IActionResult > GetExceptionServiceUnavailableAsync ( )
196196 {
197197 try
@@ -204,4 +204,18 @@ public async Task<IActionResult> GetExceptionServiceUnavailableAsync()
204204 return ResponseException . ServiceUnavailable ( HttpContext , exc ) ;
205205 }
206206 }
207+
208+ [ HttpGet ( "GatewayTimeout-Exception" ) ]
209+ public async Task < IActionResult > GetExceptionGatewayTimeoutAsync ( )
210+ {
211+ try
212+ {
213+ await Task . Delay ( 500 ) ;
214+ throw new Exception . GatewayTimeoutException ( "Gateway Timeout" ) ;
215+ }
216+ catch ( Exception . GatewayTimeoutException exc )
217+ {
218+ return ResponseException . GatewayTimeout ( HttpContext , exc ) ;
219+ }
220+ }
207221}
You can’t perform that action at this time.
0 commit comments