From 3ad0a8de8189baccb225015c7ca770521db12523 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Mon, 25 Apr 2022 21:35:24 -0500 Subject: [PATCH] Log ad-hoc bot command error for debugging --- Adhoc.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Adhoc.hs b/Adhoc.hs index 92fd71d..53c20b9 100644 --- a/Adhoc.hs +++ b/Adhoc.hs @@ -572,7 +572,9 @@ adhocBotRunCommand db componentJid routeFrom sendMessage sendIQ getMessage from | IQResult == iqType resultIQ, [cmd] <- isNamed (s"{http://jabber.org/protocol/commands}command") =<< (justZ $ iqPayload resultIQ), attributeText (s"status") cmd `elem` [Just (s"completed"), Just (s"canceled")] -> return () - | otherwise -> sendMessage $ mkSMS componentJid from (s"Command error") + | otherwise -> do + log "COMMAND ERROR" resultIQ + sendMessage $ mkSMS componentJid from (s"Command error") Nothing -> sendMessage $ mkSMS componentJid from (s"Command timed out") adhocBotSession :: (UIO.Unexceptional m) => DB.DB -> JID -> (XMPP.Message -> m ()) -> (XMPP.IQ -> UIO.UIO (STM (Maybe XMPP.IQ))) -> STM XMPP.Message -> XMPP.Message-> m () -- 2.34.2