Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception StatusError does not set name to 'StatusError' #105

Closed
SuperDermo opened this issue May 19, 2020 · 1 comment
Closed

Exception StatusError does not set name to 'StatusError' #105

SuperDermo opened this issue May 19, 2020 · 1 comment

Comments

@SuperDermo
Copy link
Contributor

The exception StatusError does not set parent name property to 'StatusError'.

Suggested (in nodejs.js):

class StatusError extends Error {
  constructor (res, ...params) {
    super(...params)

    Error.captureStackTrace(this, StatusError)
    this.name = 'StatusError' // <-- add this
    this.message = `Incorrect statusCode: ${res.statusCode}`
...
SuperDermo pushed a commit to SuperDermo/bent that referenced this issue May 28, 2020
* set name property to StatusError - mikeal#105
* pass on the actual statusMessage from the response instead of 'Incorrect statusCode ...' - mikeal#106
mikeal pushed a commit that referenced this issue Jun 26, 2020
* set name property to StatusError - #105
* pass on the actual statusMessage from the response instead of 'Incorrect statusCode ...' - #106

Co-authored-by: Tomas Dermisek <[email protected]>
@oleksii-lisovyi
Copy link

@mikeal, looks like the issue is fixed and could be closed?

@mikeal mikeal closed this as completed Aug 11, 2020
webcomick3 added a commit to webcomick3/bent that referenced this issue Jul 5, 2024
* set name property to StatusError - mikeal/bent#105
* pass on the actual statusMessage from the response instead of 'Incorrect statusCode ...' - mikeal/bent#106

Co-authored-by: Tomas Dermisek <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants