From bb662e798fe34d7c7e121f8eaad35720633f9483 Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Mon, 4 Mar 2019 15:47:22 +0000 Subject: [PATCH] Display clearer error message when GETing recipient actor fails --- src/Vervis/Handler/Inbox.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Vervis/Handler/Inbox.hs b/src/Vervis/Handler/Inbox.hs index 49e4801..9329333 100644 --- a/src/Vervis/Handler/Inbox.hs +++ b/src/Vervis/Handler/Inbox.hs @@ -66,7 +66,7 @@ import Yesod.Persist.Core (runDB, get404) import qualified Data.ByteString.Char8 as BC (unpack) import qualified Data.CaseInsensitive as CI (mk) import qualified Data.HashMap.Strict as M (lookup, insert, adjust, fromList) -import qualified Data.Text as T (pack, unpack) +import qualified Data.Text as T (pack, unpack, concat) import qualified Data.Text.Lazy as TL (toStrict) import qualified Data.Vector as V (length, cons, init) import qualified Network.Wai as W (requestMethod, rawPathInfo, requestHeaders) @@ -256,7 +256,12 @@ postOutboxR = do eres <- fetchAPID manager actorId h lto case eres of Left s -> do - setMessage $ toHtml $ T.pack s + setMessage $ toHtml $ T.concat + [ "Tried to fetch recipient actor <" + , renderFedURI $ l2f h lto + , "> and got an error: " + , T.pack s + ] return Nothing Right actor -> do let inbox = actorInbox actor