~technomancy/pengbot

0474025e1d30d114f534c878610f5ae4718b6e73 — Phil Hagelberg 3 years ago 0e41d78 master
Fix handler error handling.
1 files changed, 2 insertions(+), 4 deletions(-)

M irc.fnl
M irc.fnl => irc.fnl +2 -4
@@ 60,10 60,8 @@
      (match (pcall handler chan args)
        (true resp) (if (= :string (type resp))
                        (irc.privmsg conn chan resp))
        ;; TODO: this never triggers!
        (false msg) (do (print "Error in handler" msg)
                        (irc.privmsg conn chan (.. "Error: " msg)))
        _ (print "Unknown error!")))))
        (nil msg) (do (print "Error in handler" msg)
                      (irc.privmsg conn chan (.. "Error: " msg)))))))

;; after you've identified and are properly connected
(fn join-handler [conn prefix rest]