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
Copy file name to clipboardExpand all lines: README.md
+25-6Lines changed: 25 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -268,18 +268,24 @@ By Default: 10
268
268
269
269
---
270
270
271
-
### `customRetry`
271
+
### `retryDelay`
272
272
273
273
-`handler`. Required
274
-
-`retries`. Optional
275
274
276
-
This plugin gives the client an option to pass their own retry callback to handle retries on their own.
277
-
If a `handler` is passed to the `customRetry` object the onus is on the client to invoke the default retry logic in their callback otherwise default cases such as 503 will not be handled
275
+
This plugin gives the client an option to pass their own retry callback to allow the client to define what retryDelay they would like on any retries
276
+
outside the scope of what is handled by default in fastify-reply-from. To see the default please refer to index.js `getDefaultDelay()`
277
+
If a `handler` is passed to the `retryDelay` object the onus is on the client to invoke the default retry logic in their callback otherwise default cases such as 500 will not be handled
278
+
279
+
-`err` is the error thrown by making a request using whichever agent is configured
280
+
-`req` is the raw request details sent to the underlying agent. __Note__: this object is not a Fastify request object, but instead the low-level request for the agent.
281
+
-`res` is the raw response returned by the underlying agent (if available) __Note__: this object is not a Fastify response, but instead the low-level response from the agent. This property may be null if no response was obtained at all, like from a connection reset or timeout.
282
+
-`attempt` in the object callback refers to the current retriesAttempt number. You are given the freedom to use this in concert with the retryCount property set to handle retries
283
+
-`getDefaultRetry` refers to the default retry handler. If this callback returns not null and you wish to handle those case of errors simply invoke it as done below.
0 commit comments