-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Labels
needs triageThis issue has not been looked intoThis issue has not been looked into
Description
Is there an existing issue for this?
- I have searched the existing issues
Current behavior
const errorCause = new Error('https://www.rfc-editor.org/rfc/rfc2324');
const error = new ImATeapotException('Easter Egg', {
cause: errorCause,
});looses description: 'I'm a teapot'
while this sets description to default I'm a teapot:
const error = new ImATeapotException('Easter Egg');Can you please add this to http exceptions:
const defaultDescription = `I'm a teapot`;
// ...
constructor(
objectOrError?: any,
descriptionOrOptions: string | HttpExceptionOptions = defaultDescription,
) {
const { description = defaultDescription, httpExceptionOptions } =
HttpException.extractDescriptionAndOptionsFrom(descriptionOrOptions);
it would allow to pass cause without loosing default error description
Minimum reproduction code
na, hope code snipper in description is enough
Steps to reproduce
No response
Expected behavior
default description or error to be used in not provided in options
NestJS version
10* & 11.*
Packages versions
Node.js version
No response
In which operating systems have you tested?
- macOS
- Windows
- Linux
Other
No response
Metadata
Metadata
Assignees
Labels
needs triageThis issue has not been looked intoThis issue has not been looked into