Fix assigning properties to non-writable error object (updated) #5

Merged
joepie91 merged 1 commits from ThePendulum/node-bhttp:readonly-error into master 3 years ago

When certain errors such as a response time-out occur, the addErrorData() function would attempt to assign req/res information to the error, failing to do so because errors from the errors library are read-only.

This change removes addErrorData() in favor of using the library's option-style constructor way of assigning arbitrary properties to an error.

When certain errors such as a response time-out occur, the `addErrorData()` function would attempt to assign req/res information to the error, failing to do so because errors from the `errors` library are read-only. This change removes `addErrorData()` in favor of using the library's [option-style constructor](https://github.com/bodenr/errors#defining-error-messages) way of assigning arbitrary properties to an error.
joepie91 merged commit 5539d06789 into master 3 years ago
Owner

Thanks! Published in 1.2.8.

Thanks! Published in `1.2.8`.
The pull request has been merged as 5539d06789.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.