Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop setting potentially non-string name properties on Errors (#2963)
For example, extractError in query.js, when given a bare (bodyless) response, will pass the (numeric) httpResponse statusCode as the `code` option to util.error. util.error then sets the `name` property of the Error from this. The result is that property ends up as a number, but is required to a string; nodejs calls endsWith() on it https://github.com/nodejs/node/blob/e5d3c8121dd0bcc4dbf52c7b3a0521e359363a05/lib/internal/util/inspect.js#L922 , so will throw an exception if an Error with a non-string name is ever inspected.
- Loading branch information