fact: log some errs

This commit is contained in:
Chris Sexton 2022-10-25 13:11:15 -04:00
parent 3bedaf2ec0
commit 12543c569c
2 changed files with 4 additions and 1 deletions

View File

@ -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
}

View File

@ -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)