diff --git a/src/ZGoBackend.hs b/src/ZGoBackend.hs index 0438fb9..4d2dc7b 100644 --- a/src/ZGoBackend.hs +++ b/src/ZGoBackend.hs @@ -8,6 +8,7 @@ module ZGoBackend where import Config import Control.Concurrent (forkIO, threadDelay) +import Control.Exception (try) import Control.Monad import Control.Monad.IO.Class import Data.Aeson @@ -1041,8 +1042,10 @@ getZcashPrices = do -- | Function to update the Zcash prices in the ZGo db checkZcashPrices :: Pipe -> T.Text -> IO () checkZcashPrices p db = do - q <- getZcashPrices - mapM_ (access p master db) (updatePrices (getResponseBody q)) + q <- try getZcashPrices + case q of + Left e -> print (e :: HttpException) + Right q1 -> mapM_ (access p master db) (updatePrices (getResponseBody q1)) -- | Function to search for transactions for an address listTxs ::