-
Notifications
You must be signed in to change notification settings - Fork 19
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
Identify when a 577 error is thrown, send a new developer friendly message #180
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left one suggestion, but then this looks good to go!
Co-authored-by: Bronley Plumb <[email protected]>
src/RokuDeploy.ts
Outdated
} catch (installError: any) { | ||
switch (installError.results.response.statusCode) { | ||
case 577: | ||
throw new errors.DeviceFailedConnectionError(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pass in the installError
and set it as .cause
on the new error
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our Error
type is this:
interface Error { name: string; message: string; stack?: string; }
I just added the .cause
to the new Error type so that it can be passed in.
Let me know if that is sufficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the comments are addressed, I'm good with this!
… error as the cause so developers can trace back to the root cause of the error
No description provided.