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
Return a numeric error code for the exceptions that will be thrown #1541
Conversation
-- | There is a problem with the network connection, the user should | ||
-- investigate. | ||
-- | ||
-- TODO We're not yet returning this. |
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.
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.
We could have internal "impossible" errors, but none expected due to a bad network connection. Those would not be fatal for the node.
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.
My thinking is that when the node is started without a working internet connection, it should be reported to the wallet so that it can give some useful instructions to the user instead of some cryptic (to most non-developers) error message. Would the lack of a working internet connection result in a MuxError
or would it just time out and retry continuously?
How do you suggest we report such issues to the wallet?
Maybe it's best to remove that case from this PR for now and let you guys come up with a better way to report network connectivity issues?
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.
Can't we leave the error code and decide later on how to actually detect this?
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.
Good idea. This means we can merge as is.
ouroboros-consensus/src/Ouroboros/Consensus/Node/ExitFailure.hs
Outdated
Show resolved
Hide resolved
Fixes #1201. The node will use this `ExitFailure`s in the `toplevelExceptionHandler` (in `cardano-node`) to report to the wallet why it failed. Based on the `ExitFailure` code, the wallet can give a more useful error message and perform (or instruct the user to perform) the right action.
585c5b6
to
d4737d8
Compare
bors r+ |
1541: Return a numeric error code for the exceptions that will be thrown r=mrBliss a=mrBliss Fixes #1201. The node will use this `ExitFailure`s in the `toplevelExceptionHandler` (in `cardano-node`) to report to the wallet why it failed. Based on the `ExitFailure` code, the wallet can give a more useful error message and perform (or instruct the user to perform) the right action. Co-authored-by: Thomas Winant <thomas@well-typed.com>
Fixes #1201.
The node will use this
ExitFailure
s in thetoplevelExceptionHandler
(incardano-node
) to report to the wallet why it failed. Based on theExitFailure
code, the wallet can give a more useful error message andperform (or instruct the user to perform) the right action.