kriskowal/q-connection — pull request #32 by Stuk (2014-02-27 07:26:06+00:00)
Title: Add a sanitizeError option and specs

:warning: 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.