instana / nodejs

Node.js in-process collectors for Instana
MIT License
69 stars 36 forks source link

Decorate errors with non-enumerable properties #90

Closed jonathansamines closed 6 years ago

jonathansamines commented 6 years ago

When this library is enabled, seems like http errors gets decorated with the current request information if available.

See:

However, if for some reason, an application which prints the error (e.g in an express error handler), with a method that inspects all enumerable properties, then the current request object may be printed, and that may be a problem for a couple of reasons:

Would it make sense to change those properties to be non enumerable by default?

basti1302 commented 6 years ago

I think we can get rid of attaching the context to the error object entirely. Thanks for bringing it up. A fix will land in v1.50.1.

jonathansamines commented 6 years ago

@basti1302 Thanks for the quick response. Will give the new version a try.