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.
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b ThePendulum-readonly-error master
git pull readonly-error

Step 2:

Merge the changes and update on Gitea.
git checkout master
git merge --no-ff ThePendulum-readonly-error
git push origin master
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: joepie91/node-bhttp#5
Loading…
There is no content yet.