Skip to content

Commit ff4e981

Browse files
committed
fix(common): handle validation pipe exception
1 parent f74dd07 commit ff4e981

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/common/global.filter.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {
22
ArgumentsHost,
3+
BadRequestException,
34
Catch,
45
HttpException,
56
InternalServerErrorException,
@@ -21,6 +22,9 @@ export class GlobalExceptionFilter extends BaseExceptionFilter {
2122
}
2223

2324
let httpException: HttpException = new InternalServerErrorException();
25+
if (exception instanceof BadRequestException) {
26+
httpException = exception;
27+
}
2428
if (exception instanceof FileNotExistException) {
2529
httpException = new NotFoundException(exception.message);
2630
}

0 commit comments

Comments
 (0)