From 417fcd3e94a4751c5674827a0100d3da92cf1919 Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Sun, 24 May 2020 13:53:31 +0000 Subject: [PATCH] S2S: If sharer inbox handler fails, return and log the error message --- src/Vervis/Handler/Inbox.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Vervis/Handler/Inbox.hs b/src/Vervis/Handler/Inbox.hs index 7e7d474..2ef4929 100644 --- a/src/Vervis/Handler/Inbox.hs +++ b/src/Vervis/Handler/Inbox.hs @@ -37,6 +37,7 @@ import Control.Concurrent.STM.TVar (readTVarIO, modifyTVar') import Control.Exception hiding (Handler) import Control.Monad import Control.Monad.IO.Class (liftIO) +import Control.Monad.Logger.CallStack import Control.Monad.STM (atomically) import Control.Monad.Trans.Except import Data.Aeson @@ -58,7 +59,7 @@ import Text.Blaze.Html (Html, preEscapedToHtml) import Text.Blaze.Html.Renderer.Text import Text.HTML.SanitizeXSS import Text.Shakespeare.I18N (RenderMessage) -import Yesod.Core +import Yesod.Core hiding (logDebug) import Yesod.Core.Handler import Yesod.Form.Fields import Yesod.Form.Functions @@ -277,7 +278,9 @@ postSharerInboxR shrRecip = do (actbObject body,) <$> handleSharerInbox now shrRecip auth body recordActivity now result contentTypes case result of - Left _ -> sendResponseStatus badRequest400 () + Left err -> do + logDebug err + sendResponseStatus badRequest400 err Right _ -> return () recordActivity now result contentTypes = do