Skip to content

Add a sanitizeError option and specs#32

Open
Stuk wants to merge 1 commit into
kriskowal:masterfrom
Stuk:sanitize-error
Open

Add a sanitizeError option and specs#32
Stuk wants to merge 1 commit into
kriskowal:masterfrom
Stuk:sanitize-error

Conversation

@Stuk

@Stuk Stuk commented Feb 27, 2014

Copy link
Copy Markdown
Collaborator

⚠️ 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
Copy Markdown

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

@kriskowal

Copy link
Copy Markdown
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
Copy Markdown

@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