Skip to content

Allow exception details when sending error#122

Open
nirizr wants to merge 1 commit intoavoylenko:mainfrom
nirizr:nirizr/senderror_exception_details
Open

Allow exception details when sending error#122
nirizr wants to merge 1 commit intoavoylenko:mainfrom
nirizr:nirizr/senderror_exception_details

Conversation

@nirizr
Copy link
Copy Markdown
Contributor

@nirizr nirizr commented Mar 14, 2026

This change allows calling sendErrorResponse with an exception (instead of a string) to include exception details within the returned error. This helps in debugging issues, while currently keeping the existing behavior with no change.

Ideally replacing message in calls to sendErrorResponse with the exception object will make error responses easier to understand.

Exposing the additional details may be a bit insecure, so it's smarted to control with a debug flag.

This change allows calling sendErrorResponse with an exception (instead of a string) to include exception details within the returned error.
This helps in debugging issues, while currently keeping the existing behavior with no change.

Ideally replacing message in calls to sendErrorResponse with the exception object will make error responses easier to understand.

Exposing the additional details may be a bit insecure, so it's smarted to control with a debug flag.
@avoylenko
Copy link
Copy Markdown
Owner

This implementation leaks internal data to the world. Full data captured by pino and a service owner is able to provide it per request. Sorry, i can't give the PR a go.

@nirizr
Copy link
Copy Markdown
Contributor Author

nirizr commented Apr 2, 2026

Thanks for taking your time. I'm fully aware of the internal info exposed (as mentioned in my last sentence).

If there's a builtin way to get the entire trace for an exception i'd gladly use it.
Can you point me into retrieving that info from a wwebjs-api instance I'm running? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants