From 12543c569ca14ceaf19958939d65a7bd2df84e24 Mon Sep 17 00:00:00 2001 From: Chris Sexton <3216719+chrissexton@users.noreply.github.com> Date: Tue, 25 Oct 2022 13:11:15 -0400 Subject: [PATCH] fact: log some errs --- plugins/fact/fact.go | 3 +++ plugins/fact/factoid.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/fact/fact.go b/plugins/fact/fact.go index 2b43721..5a32a39 100644 --- a/plugins/fact/fact.go +++ b/plugins/fact/fact.go @@ -50,6 +50,9 @@ func findAlias(db *sqlx.DB, fact string) (bool, *Factoid) { return false, nil } f, err := a.resolve(db) + if err != nil { + log.Error().Err(err).Msg("findAlias") + } return err == nil, f } diff --git a/plugins/fact/factoid.go b/plugins/fact/factoid.go index a5cbbe5..d4098e8 100644 --- a/plugins/fact/factoid.go +++ b/plugins/fact/factoid.go @@ -157,6 +157,7 @@ func (p *FactoidPlugin) findTrigger(fact string) (bool, *Factoid) { f, err := GetSingleFact(p.db, fact) if err != nil { + log.Error().Err(err).Msg("GetSingleFact") return findAlias(p.db, fact) } return true, f @@ -465,7 +466,6 @@ func (p *FactoidPlugin) register() { log.Debug().Msgf("Message: %+v", r) - // This plugin has no business with normal messages if !message.Command { // look for any triggers in the db matching this message return p.trigger(c, message)