Skip to content

Allow exception details when sending error#122

Closed
nirizr wants to merge 1 commit into
avoylenko:mainfrom
nirizr:nirizr/senderror_exception_details
Closed

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

Conversation

@nirizr

@nirizr nirizr commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

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

nirizr commented Apr 2, 2026

Copy link
Copy Markdown
Contributor Author

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!

@avoylenko

Copy link
Copy Markdown
Owner

@nirizr better later than never, so i pushed a commit with error tracing for all exceptions that could arise on controller level 4e2f591

@avoylenko avoylenko closed this May 30, 2026
@nirizr

nirizr commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

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