mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
style(): run prettier
This commit is contained in:
@@ -59,14 +59,15 @@ class ClientOptionService implements ClientsModuleOptionsFactory {
|
||||
name: 'USE_CLASS_CLIENT',
|
||||
useClass: ClientOptionService,
|
||||
inject: [ConfigService],
|
||||
}, {
|
||||
},
|
||||
{
|
||||
imports: [ConfigModule],
|
||||
inject: [ConfigService],
|
||||
name: 'CUSTOM_PROXY_CLIENT',
|
||||
useFactory: (config: ConfigService) => ({
|
||||
customClass: ErrorHandlingProxy
|
||||
})
|
||||
}
|
||||
customClass: ErrorHandlingProxy,
|
||||
}),
|
||||
},
|
||||
]),
|
||||
],
|
||||
controllers: [AppController],
|
||||
|
||||
@@ -14,23 +14,21 @@ export class DisconnectedClientController {
|
||||
@Post()
|
||||
call(@Body() options): Observable<number> {
|
||||
const client = ClientProxyFactory.create(options);
|
||||
return client
|
||||
.send<number, number[]>({ cmd: 'none' }, [1, 2, 3])
|
||||
.pipe(
|
||||
/*tap(
|
||||
return client.send<number, number[]>({ cmd: 'none' }, [1, 2, 3]).pipe(
|
||||
/*tap(
|
||||
console.log.bind(console, 'data'),
|
||||
console.error.bind(console, 'error'),
|
||||
),*/
|
||||
catchError(error => {
|
||||
const { code } = error || { code: 'CONN_ERR' };
|
||||
return throwError(() =>
|
||||
code === 'ECONNREFUSED' ||
|
||||
code === 'CONN_ERR' ||
|
||||
code === 'CONNECTION_REFUSED'
|
||||
? new RequestTimeoutException('ECONNREFUSED')
|
||||
: new InternalServerErrorException(),
|
||||
);
|
||||
}),
|
||||
);
|
||||
catchError(error => {
|
||||
const { code } = error || { code: 'CONN_ERR' };
|
||||
return throwError(() =>
|
||||
code === 'ECONNREFUSED' ||
|
||||
code === 'CONN_ERR' ||
|
||||
code === 'CONNECTION_REFUSED'
|
||||
? new RequestTimeoutException('ECONNREFUSED')
|
||||
: new InternalServerErrorException(),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,8 @@ const explicitPartitioner = () => {
|
||||
|
||||
@Controller()
|
||||
export class KafkaConcurrentController
|
||||
implements OnModuleInit, OnModuleDestroy {
|
||||
implements OnModuleInit, OnModuleDestroy
|
||||
{
|
||||
protected readonly logger = new Logger(KafkaConcurrentController.name);
|
||||
|
||||
@Client({
|
||||
|
||||
Reference in New Issue
Block a user