创建错误处理拦截器errors interceptor,之前好像有个过滤器filters?
This commit is contained in:
parent
d56b4f21db
commit
3e83be0032
|
@ -0,0 +1,7 @@
|
||||||
|
import { ErrorsInterceptor } from './errors.interceptor';
|
||||||
|
|
||||||
|
describe('ErrorsInterceptor', () => {
|
||||||
|
it('should be defined', () => {
|
||||||
|
expect(new ErrorsInterceptor()).toBeDefined();
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,9 @@
|
||||||
|
import { CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class ErrorsInterceptor implements NestInterceptor {
|
||||||
|
intercept(context: ExecutionContext, next: CallHandler): Observable<any> {
|
||||||
|
return next.handle();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue