Skip to content

Commit 5143fc6

Browse files
fix(microservices): fix broken unit tests (exception filter)
1 parent eb8f4ec commit 5143fc6

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

packages/microservices/decorators/message-pattern.decorator.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { PATTERN_HANDLER_METADATA, PATTERN_METADATA } from '../constants';
22
import { PatternHandler } from '../enums/pattern-handler.enum';
33
import { PatternMetadata } from '../interfaces/pattern-metadata.interface';
4-
import { ConsumerConfig } from '../external/kafka.interface';
54

65
export enum GrpcMethodStreamingType {
76
NO_STREAMING = 'no_stream',

packages/microservices/exceptions/base-rpc-exception-filter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ export class BaseRpcExceptionFilter<T = any, R = any>
1111
public catch(exception: T, host: ArgumentsHost): Observable<R> {
1212
const status = 'error';
1313
if (!(exception instanceof RpcException)) {
14-
return this.handleUnknownError(exception);
14+
return this.handleUnknownError(exception, status);
1515
}
1616
const res = exception.getError();
1717
const message = isObject(res) ? res : { status, message: res };
1818
return _throw(message);
1919
}
2020

21-
public handleUnknownError(exception: T) {
21+
public handleUnknownError(exception: T, status: string) {
2222
const errorMessage = MESSAGES.UNKNOWN_EXCEPTION_MESSAGE;
2323

2424
const loggerArgs = this.isError(exception)

0 commit comments

Comments
 (0)