MCPcopy
hub / github.com/nestjs/nest / serializeError

Method serializeError

integration/microservices/src/app.controller.ts:82–92  ·  view source on GitHub ↗
(
    @Query('client') query: 'custom' | 'standard' = 'standard',
    @Body() body: Record<string, any>,
  )

Source from the content-addressed store, hash-verified

80 @Post('error')
81 @HttpCode(200)
82 serializeError(
83 @Query('client') query: 'custom' | 'standard' = 'standard',
84 @Body() body: Record<string, any>,
85 ): Observable<boolean> {
86 const client = query === 'custom' ? this.customClient : this.client;
87 return client.send({ cmd: 'err' }, {}).pipe(
88 catchError(err => {
89 return of(err instanceof RpcException);
90 }),
91 );
92 }
93
94 @MessagePattern({ cmd: 'sum' })
95 sum(data: number[]): number {

Callers 3

createObserverFunction · 0.45

Calls 4

QueryFunction · 0.90
BodyFunction · 0.90
pipeMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected