Skip to content
Snippets Groups Projects
Unverified Commit 14892e39 authored by chris48s's avatar chris48s Committed by GitHub
Browse files

Implement a pattern for dealing with upstream APIs which are slow on the first...

Implement a pattern for dealing with upstream APIs which are slow on the first hit; affects [endpoint] (#9233)

* allow serviceData to override cacheSeconds with a longer value

* prevent [endpoint] json cacheSeconds property exceeding service default

* allow ShieldsRuntimeError to specify a cacheSeconds property

By default error responses use the cacheLength of
the service class throwing the error.

This allows error to tell the handling layer the maxAge
that should be set on the error badge response.

* add customExceptions param

This

1. allows us to specify custom properties to pass to the exception
   constructor if we throw any of the standard got errors
   e.g: `ETIMEDOUT`, `ECONNRESET`, etc
2. uses a custom `cacheSeconds` property (if set on the exception)
   to set the response maxAge

* customExceptions --> systemErrors

* errorMessages --> httpErrors
parent 2651e5fe
No related branches found
No related tags found
No related merge requests found
Showing
with 137 additions and 46 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment