Display clearer error message when GETing recipient actor fails

This commit is contained in:
fr33domlover 2019-03-04 15:47:22 +00:00
parent 78b5bad2c4
commit bb662e798f

View file

@ -66,7 +66,7 @@ import Yesod.Persist.Core (runDB, get404)
import qualified Data.ByteString.Char8 as BC (unpack) import qualified Data.ByteString.Char8 as BC (unpack)
import qualified Data.CaseInsensitive as CI (mk) import qualified Data.CaseInsensitive as CI (mk)
import qualified Data.HashMap.Strict as M (lookup, insert, adjust, fromList) 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.Text.Lazy as TL (toStrict)
import qualified Data.Vector as V (length, cons, init) import qualified Data.Vector as V (length, cons, init)
import qualified Network.Wai as W (requestMethod, rawPathInfo, requestHeaders) import qualified Network.Wai as W (requestMethod, rawPathInfo, requestHeaders)
@ -256,7 +256,12 @@ postOutboxR = do
eres <- fetchAPID manager actorId h lto eres <- fetchAPID manager actorId h lto
case eres of case eres of
Left s -> do 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 return Nothing
Right actor -> do Right actor -> do
let inbox = actorInbox actor let inbox = actorInbox actor