Skip to content

Commit

Permalink
Merge #1992
Browse files Browse the repository at this point in the history
1992: Add user advice to `UnableToDetermineCurrentEpoch` error. r=jonathanknowles a=jonathanknowles

# Issue Number

#1939 

# Overview

This PR revises the error we show if we cannot determine the current epoch, inviting the user to wait and try again.

# Comments

Ideally, we'd be able to give the user some indication of _how long_ they should wait, but assuming we cannot reliably know this information, letting them know that waiting may resolve the issue is arguably better than giving no advice at all.


Co-authored-by: Jonathan Knowles <jonathan.knowles@iohk.io>
  • Loading branch information
iohk-bors[bot] and jonathanknowles committed Aug 3, 2020
2 parents 29c040b + 5dc5295 commit d51b74d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/core/src/Cardano/Wallet/Api/Server.hs
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."
]

instance LiftHandler ErrUnexpectedPoolIdPlaceholder where
handler = \case
Expand Down

0 comments on commit d51b74d

Please sign in to comment.