Skip to content

Commit

Permalink
fix(http): remove axios reference in type defs
Browse files Browse the repository at this point in the history
resolves #1991
  • Loading branch information
BrunnerLivio committed Aug 10, 2022
1 parent 2f46ee6 commit d449820
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions lib/errors/axios.error.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export interface AxiosError extends Error {
code?: string;
request?: any;
response?: any;
isAxiosError: boolean;
status?: string;
toJSON: () => object;
}
2 changes: 1 addition & 1 deletion lib/health-indicator/http/http.health.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Injectable, Scope } from '@nestjs/common';
import { AxiosError } from 'axios';
import { HealthIndicator, HealthIndicatorResult } from '..';
import { HealthCheckError } from '../../health-check/health-check.error';
import { lastValueFrom, Observable } from 'rxjs';
Expand All @@ -9,6 +8,7 @@ import type * as NestJSAxios from '@nestjs/axios';
import { AxiosRequestConfig, AxiosResponse } from './axios.interfaces';
import { Logger } from '@nestjs/common/services/logger.service';
import { URL } from 'url';
import { AxiosError } from '../../errors/axios.error';

const logger = new Logger('HttpHealthIndicator');

Expand Down
3 changes: 2 additions & 1 deletion lib/utils/is-error.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { AxiosError } from '../errors/axios.error';
import { HealthCheckError } from '../';
import { AxiosError } from 'axios';


export function isHealthCheckError(err: any): err is HealthCheckError {
return err?.isHealthCheckError;
Expand Down

0 comments on commit d449820

Please sign in to comment.