A peer-to-peer stack for code collaboration
Improve display of send! and receive!
Thomas Scholtesd69d0e64e008
diff --git a/src/Radicle/Internal/HttpStorage.hs b/src/Radicle/Internal/HttpStorage.hsindex 3795e46..59a1c49 100644--- a/src/Radicle/Internal/HttpStorage.hs+++ b/src/Radicle/Internal/HttpStorage.hs@@ -94,7 +94,7 @@ httpStoragePrimFns' mgr =\ chain located at the URL for evaluation.", \url values -> dores <- liftIO $ runClientM' url mgr (submit $ toList values)- pure $ bimap fmtError (const ()) res+ pure $ bimap formatServantError (const ()) res), storageReceive =( "receive!"@@ -102,13 +102,14 @@ httpStoragePrimFns' mgr =\ for the last `n` inputs that have been evaluated.", \url index -> dores <- liftIO $ runClientM' url mgr (since index)- pure $ first show res+ pure $ first formatServantError res)}where- fmtError = \case+ formatServantError = \caseFailureResponse Response{..} ->"status code: " <> show (fromEnum responseStatusCode) <> "\n" <> toS responseBody+ ConnectionError err -> errse -> show sesubmit :: [Value] -> ClientM Valuediff --git a/src/Radicle/Internal/Storage.hs b/src/Radicle/Internal/Storage.hsindex 09ed60a..62035bb 100644--- a/src/Radicle/Internal/Storage.hs+++ b/src/Radicle/Internal/Storage.hs@@ -72,7 +72,7 @@ buildStoragePrimFns backend =res <- lift $ receive id ncase res ofLeft err -> throwErrorHere . OtherError- $ receiveName <> ": request failed: " <> show err+ $ receiveName <> ": request failed: " <> errRight v' -> pure $ List v'(String _, v) -> throwErrorHere $ TypeError receiveName 1 TNumber v(v, _) -> throwErrorHere $ TypeError receiveName 0 TString v