Skip to content

Commit

Permalink
Add user advice to UnableToDetermineCurrentEpoch error.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jonathanknowles committed Aug 3, 2020
1 parent 29c040b commit 5dc5295
Showing 1 changed file with 4 additions and 2 deletions.
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."
]

instance LiftHandler ErrUnexpectedPoolIdPlaceholder where
handler = \case
Expand Down

0 comments on commit 5dc5295

Please sign in to comment.