From 5dc52958ebc312218133db8ee143f3430d904757 Mon Sep 17 00:00:00 2001 From: Jonathan Knowles Date: Mon, 3 Aug 2020 05:19:12 +0000 Subject: [PATCH] Add user advice to `UnableToDetermineCurrentEpoch` error. 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. --- lib/core/src/Cardano/Wallet/Api/Server.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/core/src/Cardano/Wallet/Api/Server.hs b/lib/core/src/Cardano/Wallet/Api/Server.hs index 5b7e3a9188d..3a24eb05d97 100644 --- a/lib/core/src/Cardano/Wallet/Api/Server.hs +++ b/lib/core/src/Cardano/Wallet/Api/Server.hs @@ -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