I'm very new to Kafka/microservices, and I'm not understanding how error handling should work on these.
If I have no RpcException filter in place, the default RpcExceptionHandler seems to just catch the error and the entire microservice application just hangs.
Creating an RpcException filter allows me to catch exceptions that I explicitly throw, but it doesn't do anything for unhandled exceptions. Those still crash the app.
What am I missing here?
Controller:
import { Controller, Get } from '@nestjs/common';
import { MessagePattern, RpcException } from '@nestjs/microservices';
import { AppService } from './app.service';
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
@MessagePattern('get-accounts')
getUser(data: any) {
return this.appService.getHello();
}
}
Logs
[Nest] 24760 - 09/09/2022, 12:09:25 PM ERROR [RpcExceptionsHandler] Request failed with status code 404
[Nest] 24760 - 09/09/2022, 12:09:25 PM ERROR [RpcExceptionsHandler] undefined