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

Add user advice to UnableToDetermineCurrentEpoch error. #1992

Merged
merged 1 commit into from
Aug 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/core/src/Cardano/Wallet/Api/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1997,8 +1997,10 @@ showT = T.pack . show
instance LiftHandler ErrCurrentEpoch where
handler = \case
ErrUnableToDetermineCurrentEpoch ->
apiError err500 UnableToDetermineCurrentEpoch
"I'm unable to determine the current epoch."
apiError err500 UnableToDetermineCurrentEpoch $ mconcat
[ "I'm unable to determine the current epoch. "
, "Please wait a while for the node to sync and try again."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's unexpected for a node client to not know which epoch they are in at any time, it might be helpful to add a little detail as to why this cannot be known. If it's too complex to provide over an error message, maybe a link to some docs would be something to add later when available. I assume this is a common issue for chain-sync clients.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's too complex to provide over an error message, maybe a link to some docs would be something to add later when available.

This sounds like a sensible suggestion. 👍

From conversations with @Anviking, it seems that this situation will only occur very rarely, around the time of a hard fork, and when a node is not yet fully in sync. I think if we do start seeing reports of this error in the wild, we can look into adding more information to the error.

]

instance LiftHandler ErrUnexpectedPoolIdPlaceholder where
handler = \case
Expand Down