File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -10,13 +10,13 @@ The following example uses a manually instantiated method-scoped pipe. Just as w
10
10
11
11
``` typescript
12
12
@@filename ()
13
- @UsePipes (new ValidationPipe ())
13
+ @UsePipes (new ValidationPipe ({ exceptionFactory : ( errors ) => new RpcException ( errors ) } ))
14
14
@MessagePattern ({ cmd: ' sum' })
15
15
accumulate (data : number []): number {
16
16
return (data || []).reduce ((a , b ) => a + b );
17
17
}
18
18
@@switch
19
- @UsePipes (new ValidationPipe ())
19
+ @UsePipes (new ValidationPipe ({ exceptionFactory : ( errors ) => new RpcException ( errors ) } ))
20
20
@MessagePattern ({ cmd: ' sum' })
21
21
accumulate (data ) {
22
22
return (data || []).reduce ((a , b ) => a + b );
Original file line number Diff line number Diff line change @@ -10,14 +10,14 @@ The following example uses a manually instantiated method-scoped pipe. Just as w
10
10
11
11
``` typescript
12
12
@@filename ()
13
- @UsePipes (new ValidationPipe ())
13
+ @UsePipes (new ValidationPipe ({ exceptionFactory : ( errors ) => new WsException ( errors ) } ))
14
14
@SubscribeMessage (' events' )
15
15
handleEvent (client : Client , data : unknown ): WsResponse < unknown > {
16
16
const event = ' events' ;
17
17
return { event , data };
18
18
}
19
19
@@switch
20
- @UsePipes (new ValidationPipe ())
20
+ @UsePipes (new ValidationPipe ({ exceptionFactory : ( errors ) => new WsException ( errors ) } ))
21
21
@SubscribeMessage (' events' )
22
22
handleEvent (client , data ) {
23
23
const event = ' events' ;
You can’t perform that action at this time.
0 commit comments