Skip to content

Commit 2c63a41

Browse files
committed
fixing lint error etc
1 parent 5c00d48 commit 2c63a41

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

examples/failing.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ try {
1010
path: '/',
1111
method: 'GET',
1212
});
13+
// eslint-disable-next-line no-unused-vars
1314
} catch (_) {
1415
// Mute the first one, next request should hit an open breaker
1516
}

lib/http-client.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ export default class HttpClient {
7979

8080
if (fallback) {
8181
this.#hasFallback = true;
82-
this.#fallback(fallback);
82+
if (typeof fallback === 'string') {
83+
this.#fallback(() => fallback);
84+
} else {
85+
this.#fallback(fallback);
86+
}
8387
}
8488
}
8589

@@ -164,6 +168,7 @@ export default class HttpClient {
164168
export class HttpClientError extends Error {
165169
// Not sure if there is a need for this tbh, but I threw it in there so we can see how it feels.
166170
static ServerDown = 'EOPENBREAKER';
171+
167172
constructor(message, { code, cause, options }) {
168173
super(message);
169174
this.name = 'HttpClientError';

0 commit comments

Comments
 (0)