Skip to content

Commit c234aa5

Browse files
committed
pass AbortError to caller
1 parent 15d6e52 commit c234aa5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/health.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import fetch from 'node-fetch';
1+
import fetch, { AbortError } from 'node-fetch';
22
import { KubeConfig } from './config';
33
import { RequestOptions } from 'node:https';
44

@@ -48,7 +48,10 @@ export class Health {
4848
return this.healthz(opts);
4949
}
5050
return false;
51-
} catch {
51+
} catch (err: unknown) {
52+
if (err instanceof Error && err.name === 'AbortError') {
53+
throw err;
54+
}
5255
throw new Error('Error occurred in health request');
5356
}
5457
}

0 commit comments

Comments
 (0)