NestJS - Interceptors
Identify the error in this TimeoutInterceptor implementation:
intercept(context, next) {
return next.handle().pipe(
timeout(3000),
catchError(err => {
throw new RequestTimeoutException();
})
);
}Identify the error in this TimeoutInterceptor implementation:
intercept(context, next) {
return next.handle().pipe(
timeout(3000),
catchError(err => {
throw new RequestTimeoutException();
})
);
}catchError, throwing an error directly breaks the observable chain; it should return an observable error using throwError.throw inside catchError instead of returning an observable error. is the error.throw inside catchError instead of returning an observable error. -> Option A15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions