Skip to content
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

Add a sanitizeError option and specs #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Stuk
Copy link
Collaborator

@Stuk Stuk commented Feb 27, 2014

⚠️ First pass at this idea. Happy to have a discussion about it. Also, the readme should be updated, but I didn't want to put that effort in until the approach has been approved.

Error objects often contain information, such as the stack, that should not be exposed to the client.

This adds the ability to give a sanitizeError function to the Connection that will be called whenever an Error is encoded. The return value of this function is used in place of the original error.

Error objects often contain information, such as the stack, that
should not be exposed to the client.

This adds the ability to give a `sanitizeError` function to the
Connection that will be called whenever an Error is encoded. The
return value of this function is used in place of the original error.
@mczepiel
Copy link

I, for one, would appreciate having such an ability to prevent leaking server information. Looks straightforward enough to serve my needs.

@kriskowal
Copy link
Owner

I think that it might be sufficient to sanitize errors by default, and turn off sanitization with a debug option. Perhaps "debug" for one and "trace" for logging.

@mczepiel
Copy link

@Stuk had a nice idea that benefitted from being able to alter how the sanitization happens: reporting some id for the exceptional event to the user for support purposes. (Though that sort of thing could be implemented without informing the end user, with the benefit of it appearing all the more magical)

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.

3 participants