We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3f940c commit 063ed06Copy full SHA for 063ed06
lib/http-client.js
@@ -22,6 +22,7 @@ export default class HttpClient {
22
#abortController;
23
#agent;
24
#breaker;
25
+ #hasFallback = false;
26
#logger;
27
#throwOn400;
28
#throwOn500;
@@ -69,6 +70,7 @@ export default class HttpClient {
69
70
});
71
72
if (fallback) {
73
+ this.#hasFallback = true;
74
this.#fallback(fallback);
75
}
76
@@ -120,7 +122,7 @@ export default class HttpClient {
120
122
try {
121
123
return await this.#breaker.fire(options);
124
} catch (error) {
- if (!this.fallback) {
125
+ if (!this.#hasFallback) {
126
throw new HttpClientError(
127
`Error on ${options.method} ${options.origin}${options.path}`,
128
{
0 commit comments