Add option to disable injecting context into error
Adds the ability to disable the injection of the current context onto thrown errors.
The motivation behind this is to solve an issue I was having with logging errors when the current context contains an object with circular references. Furthermore, adding properties to error objects feels a little intrusive and there should be a way to disable it if desired.
bump
Is this project still being maintained?
Not sure I really see much value to this, seems like your error logging should just be filtering properties better. Adding contextual properties onto error objects is very common: many ORM libraries do it, most routing frameworks do it too, even node core adds extra non-standard stuff onto errors.
This still allows adding contextual properties to error objects (it even leaves it on by default), it just gives the option to turn it off. We have logging filtering, but I'd prefer if we could remove the context in general.
@kschat We had similar issues logging odd 3rd party objects and errors. Here's a gist we used to help keep the objects and errors clean for logging.