File tree Expand file tree Collapse file tree
shared-code/src/data-access-layer/data-access-objects Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,21 +5,21 @@ import { Messages } from '../exceptions/text/messages.js';
55
66@Injectable ( )
77export class TimeoutInterceptor implements NestInterceptor {
8- intercept ( _context : ExecutionContext , next : CallHandler ) : Observable < any > {
9- const timeoutMs = process . env . NODE_ENV !== 'test' ? 15000 : 200000 ;
10- return next . handle ( ) . pipe (
11- timeout ( timeoutMs ) ,
12- catchError ( ( err ) => {
13- if ( err instanceof TimeoutError ) {
14- return throwError (
15- ( ) =>
16- new RequestTimeoutException ( {
17- message : Messages . CONNECTION_TIMED_OUT ,
18- } ) ,
19- ) ;
20- }
21- return throwError ( ( ) => err ) ;
22- } ) ,
23- ) ;
24- }
8+ intercept ( _context : ExecutionContext , next : CallHandler ) : Observable < any > {
9+ const timeoutMs = process . env . NODE_ENV !== 'test' ? 15000 : 200000 ;
10+ return next . handle ( ) . pipe (
11+ timeout ( timeoutMs ) ,
12+ catchError ( ( err ) => {
13+ if ( err instanceof TimeoutError ) {
14+ return throwError (
15+ ( ) =>
16+ new RequestTimeoutException ( {
17+ message : Messages . CONNECTION_TIMED_OUT ,
18+ } ) ,
19+ ) ;
20+ }
21+ return throwError ( ( ) => err ) ;
22+ } ) ,
23+ ) ;
24+ }
2525}
You can’t perform that action at this time.
0 commit comments