-
Expected Behavior / New Featurewhen an exception (404 NotFound exception) occur in ocelot. when we use try-catch try to catch this exception, we should be able catch this exception. Actual Behavior / Motivation for New Featureocelot not throw this exception, swallowed, so the try-catch did not work. Steps to Reproduce the Problem
Specifications
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@Tingtzong |
Beta Was this translation helpful? Give feedback.
-
Exactly! Have you ever heard or read about Error Status Codes feature? Please develop Delegating Handler to catch exceptions in and read original status of downstream service response. Also, |
Beta Was this translation helpful? Give feedback.
@Tingtzong
Exactly! Have you ever heard or read about Error Status Codes feature?
We have a global Exception handler which prevents Ocelot instance failing/hanging because of 5xx errors in downstream services.
But we don't consider this design good because we override status and some headers. See notes about Design
Please develop Delegating Handler to catch exceptions in and read original status of downstream service response.
A delegating handler is exactly right place to catch exception, but we recommend to re-throw it!
Also,
PreErrorResponderMiddleware
injection sho…