Skip to content

Commit

Permalink
fix: responseCheck throwing internal error (#2395) (#2452)
Browse files Browse the repository at this point in the history
Co-authored-by: chamsou123 <agounichams@gmail.com>
  • Loading branch information
chamsou123 and chamsou123 authored Jan 26, 2024
1 parent 7ad1dd5 commit 5df9aff
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/health-indicator/http/http.health.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,13 @@ export class HttpHealthIndicator extends HealthIndicator {
httpService.request({ url: url.toString(), ...options }),
);
} catch (error) {
if (isAxiosError(error) && error.response) {
response = error.response;
axiosError = error;
if (isAxiosError(error)) {
if (error.response) {
response = error.response;
axiosError = error;
} else {
throw this.generateHttpError(key, error);
}
} else {
throw error;
}
Expand Down

0 comments on commit 5df9aff

Please sign in to comment.