Skip to content

Commit cefb1aa

Browse files
author
joao Felipe Santoro Pinto
committed
docs(interceptors): Adhere throwError usage to new method signature
1 parent 8d5d00d commit cefb1aa

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

content/interceptors.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ export class ErrorsInterceptor implements NestInterceptor {
236236
return next
237237
.handle()
238238
.pipe(
239-
catchError(err => throwError(new BadGatewayException())),
239+
catchError(err => throwError(() => new BadGatewayException())),
240240
);
241241
}
242242
}
@@ -251,7 +251,7 @@ export class ErrorsInterceptor {
251251
return next
252252
.handle()
253253
.pipe(
254-
catchError(err => throwError(new BadGatewayException())),
254+
catchError(err => throwError(() => new BadGatewayException())),
255255
);
256256
}
257257
}
@@ -311,9 +311,9 @@ export class TimeoutInterceptor implements NestInterceptor {
311311
timeout(5000),
312312
catchError(err => {
313313
if (err instanceof TimeoutError) {
314-
return throwError(new RequestTimeoutException());
314+
return throwError(() => new RequestTimeoutException());
315315
}
316-
return throwError(err);
316+
return throwError(() => err);
317317
}),
318318
);
319319
};
@@ -330,9 +330,9 @@ export class TimeoutInterceptor {
330330
timeout(5000),
331331
catchError(err => {
332332
if (err instanceof TimeoutError) {
333-
return throwError(new RequestTimeoutException());
333+
return throwError(() => new RequestTimeoutException());
334334
}
335-
return throwError(err);
335+
return throwError(() => err);
336336
}),
337337
);
338338
};

0 commit comments

Comments
 (0)