You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Propagate API Gateway errors with custom exception
Introduces ApiGatewayException to propagate API Gateway error responses and status codes to the client. Updates ApiGatewayClient to throw this exception on failed responses, registers a renderable handler in the service provider, and adds a test to verify error propagation.
Copy file name to clipboardExpand all lines: README.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ This package provides a robust foundation for building Laravel-based microservic
24
24
Easily enable, disable, or rename middleware via configuration, and use convenient groups like `microservice.auth` group for full authentication and authorization in one step.
25
25
26
26
-**HTTP Client Macros:**
27
-
Pre-configured HTTP clients for communicating with your API Gateway or other services. When a request is available, these macros automatically forward the current correlation ID header.
27
+
Pre-configured HTTP clients for communicating with your API Gateway or other services. They automatically forward the current correlation ID header and propagate gateway errors to the caller.
28
28
29
29
-**Ready-to-publish Configuration:**
30
30
All settings are customizable via a single config file, making it easy to adapt the package to your environment.
**Alias**: the string you assign to `load_access` in `middleware_aliases`, e.g. `load.access`.
@@ -298,6 +296,12 @@ When enabled (default), visiting `/api/health` returns:
298
296
}
299
297
```
300
298
299
+
### HTTP Client Macros
300
+
301
+
Use `Http::apiGateway()` and its related macros for service-to-service calls. Each macro forwards the current correlation ID header when available.
302
+
303
+
If the gateway responds with an error (for example, a `503`), an `ApiGatewayException` is thrown and automatically returned to the client with the same status code.
0 commit comments