File tree 1 file changed +1
-7
lines changed
1 file changed +1
-7
lines changed Original file line number Diff line number Diff line change 1
1
import type { FileValidator } from "@common/@types" ;
2
2
import { FileSize , FileType } from "@common/@types" ;
3
3
import { CustomUploadFileTypeValidator } from "@common/decorators" ;
4
- import { HttpStatus , ParseFilePipeBuilder , UnprocessableEntityException } from "@nestjs/common" ;
4
+ import { HttpStatus , ParseFilePipeBuilder } from "@nestjs/common" ;
5
5
6
6
7
7
/**
@@ -32,11 +32,5 @@ export function fileValidatorPipe({
32
32
. build ( {
33
33
errorHttpStatusCode : HttpStatus . UNPROCESSABLE_ENTITY ,
34
34
fileIsRequired : required ,
35
- exceptionFactory ( error ) {
36
- if ( error . includes ( "expected type" ) )
37
- return new UnprocessableEntityException ( `Invalid file type. Valid file types are ${ String ( fileType ) . replaceAll ( / [ $ ( ) / ] / g, '' ) } ` ) ;
38
-
39
- return new UnprocessableEntityException ( error ) ;
40
- } ,
41
35
} ) ;
42
36
}
You can’t perform that action at this time.
0 commit comments