- use ServiceClientError type for Errors in shouldRetry and onRetry options.
- Use
timing
option from client iftiming
is not set in the request options. #91 - Improved TypeScript definition of
ServiceClientRequestFilter
. #100
- Fixed an error that is thrown when
dropRequestAfter
is set and a connection error happens. #96
- Added support for measuring TLS timings.
- Added
span
option where the tcp events will be logged. The interface matches the opentracing span interface. - Improved retries performance and memory usage.
- Added
readTimeout
options to be able to timeout when a socket is idle for a certain period of time.
- Having a circuit breaker configured no longer results in Node process not exiting properly.
- Improved circuit breaker performance and memory usage.
Added custom error classes for different error types, including ability to distinguish connection timeout error, user timeout error, and maximum retries error. For more details see Handling Errors section in the README
TypeScript type definition for request headers has been made more
strict to avoid runtime errors caused by undefined
headers.
See pull request for details.
Usage of type
field on ServiceClientError
to understand the type of the error is now deprecated in favor of instanceof
checks for new error classes added in this release.
In 0.5.0 we changed the exports of the module to be forward-compatible with ES modules. If you are using CommonJS-style require calls, they need to updated from:
const ServiceClient = require('perron')
to
const {ServiceClient} = require('perron')
So ServiceClient
is now a named export.
If you were using babel to transpile your code, no changes should be necessary.
In 0.6.0 we changed the fields of timings
and timingPhases
on ServiceClientResponse
to be nullable, or undefined
able to be accurate. Previously timings
had -1
when a field was missing, and timingPhases
had wrong numbers in those cases.