-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[QUESTION] "failed with status code 500" output instead of detailed error message #416
Labels
question
Further information is requested
Comments
Any suggestion/ work around for the above? |
same thing |
This solution works for me: main.ts const pinoLogger = await app.resolve(PinoLogger);
app.useGlobalFilters(new AllExceptionsFilter(pinoLogger)); all-exception.filter.ts export class AllExceptionsFilter implements ExceptionFilter {
constructor(private readonly logger: PinoLogger) {}
} |
solved in v2.0.0 import { Controller, Get } from '@nestjs/common';
import { AppService } from './app.service';
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
@Get()
getHello(): string {
throw new Error('foo bar baz');
return this.appService.getHello();
}
} {"level":50,"time":1630106183244,"pid":742,"hostname":"my-host","req":{"id":1,"method":"GET","url":"/","query":{},"params":{"0":""},"headers":{"host":"localhost:3000","user-agent":"curl/7.64.1","accept":"*/*"},"remoteAddress":"::1","remotePort":61739},"context":"ExceptionsHandler","msg":"foo bar baz"} |
@iamolegga cant we get the stack trace there as well? |
@kasvith please open a new feature request for that, will take a look at it when I have time |
Done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I'm throwing an error from Nest application nestjs-pino always prints in the error message "failed with status code 500" even though I'm throwing an error with a detailed message any idea how to solve this?
this is how I setup nestjs-pino
and this is how I throw the error
And nestjs-pino output
The text was updated successfully, but these errors were encountered: