From 36f29719f389eaa6f21c5c6042f74a24d9d316bb Mon Sep 17 00:00:00 2001 From: Brandon Tull Date: Wed, 6 Jan 2021 09:25:51 -0600 Subject: [PATCH 1/3] Fix Formatting and Mispellings on Error Codes Doc --- docs/features/errorcodes.rst | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/features/errorcodes.rst b/docs/features/errorcodes.rst index d07eb3a49..68a6ba98f 100644 --- a/docs/features/errorcodes.rst +++ b/docs/features/errorcodes.rst @@ -1,13 +1,14 @@ -Http Error Status Codes +HTTP Error Status Codes ======================= -Ocelot will return HTTP status error codes based on internal logic in certain siturations: -- 401 if the authentication middleware runs and the user is not authenticated. -- 403 if the authorization middleware runs and the user is unauthenticated, claim value not authroised, scope not authorized, user doesnt have required claim or cannot find claim. -- 503 if the downstream request times out. -- 499 if the request is cancelled by the client. -- 404 if unable to find a downstream route. -- 502 if unable to connect to downstream service. -- 500 if unable to complete the HTTP request downstream and the exception is not OperationCanceledException or HttpRequestException. -- 404 if Ocelot is unable to map an internal error code to a HTTP status code. +Ocelot will return HTTP status error codes based on internal logic in certain situations: + +- **401** - if the authentication middleware runs and the user is not authenticated. +- **403** - if the authorization middleware runs and the user is unauthenticated, claim value not authorized, scope not authorized, user doesn't have required claim, or cannot find claim. +- **503** - if the downstream request times out. +- **499** - if the request is cancelled by the client. +- **404** - if unable to find a downstream route. +- **502** - if unable to connect to downstream service. +- **500** - if unable to complete the HTTP request downstream and the exception is not OperationCanceledException or HttpRequestException. +- **404** - if Ocelot is unable to map an internal error code to a HTTP status code. From 34f34ef970cb0d447b738dec4c3085b3d06abefd Mon Sep 17 00:00:00 2001 From: Raman Maksimchuk Date: Tue, 11 Jul 2023 18:09:22 +0300 Subject: [PATCH 2/3] Update errorcodes.rst Change description of 500 error --- docs/features/errorcodes.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/features/errorcodes.rst b/docs/features/errorcodes.rst index 68a6ba98f..f681c4c11 100644 --- a/docs/features/errorcodes.rst +++ b/docs/features/errorcodes.rst @@ -9,6 +9,5 @@ Ocelot will return HTTP status error codes based on internal logic in certain si - **499** - if the request is cancelled by the client. - **404** - if unable to find a downstream route. - **502** - if unable to connect to downstream service. -- **500** - if unable to complete the HTTP request downstream and the exception is not OperationCanceledException or HttpRequestException. +- **500** - if unable to complete the HTTP request to downstream service, and the exception is not ``OperationCanceledException`` or ``HttpRequestException``. - **404** - if Ocelot is unable to map an internal error code to a HTTP status code. - From da8fd02d60f4ab44318de0879416c0415cdf314c Mon Sep 17 00:00:00 2001 From: Raman Maksimchuk Date: Tue, 11 Jul 2023 18:26:39 +0300 Subject: [PATCH 3/3] Update errorcodes.rst Add sections as code classes. Sort status codes --- docs/features/errorcodes.rst | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/features/errorcodes.rst b/docs/features/errorcodes.rst index f681c4c11..a9fffd2a6 100644 --- a/docs/features/errorcodes.rst +++ b/docs/features/errorcodes.rst @@ -3,11 +3,17 @@ HTTP Error Status Codes Ocelot will return HTTP status error codes based on internal logic in certain situations: +Client error responses +---------------------- + - **401** - if the authentication middleware runs and the user is not authenticated. - **403** - if the authorization middleware runs and the user is unauthenticated, claim value not authorized, scope not authorized, user doesn't have required claim, or cannot find claim. -- **503** - if the downstream request times out. +- **404** - if unable to find a downstream route, or Ocelot is unable to map an internal error code to a HTTP status code. - **499** - if the request is cancelled by the client. -- **404** - if unable to find a downstream route. -- **502** - if unable to connect to downstream service. + +Server error responses +---------------------- + - **500** - if unable to complete the HTTP request to downstream service, and the exception is not ``OperationCanceledException`` or ``HttpRequestException``. -- **404** - if Ocelot is unable to map an internal error code to a HTTP status code. +- **502** - if unable to connect to downstream service. +- **503** - if the downstream request times out.