mirror of https://github.com/velour/catbase.git
fact: log some errs
This commit is contained in:
parent
3bedaf2ec0
commit
12543c569c
|
@ -50,6 +50,9 @@ func findAlias(db *sqlx.DB, fact string) (bool, *Factoid) {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
f, err := a.resolve(db)
|
f, err := a.resolve(db)
|
||||||
|
if err != nil {
|
||||||
|
log.Error().Err(err).Msg("findAlias")
|
||||||
|
}
|
||||||
return err == nil, f
|
return err == nil, f
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -157,6 +157,7 @@ func (p *FactoidPlugin) findTrigger(fact string) (bool, *Factoid) {
|
||||||
|
|
||||||
f, err := GetSingleFact(p.db, fact)
|
f, err := GetSingleFact(p.db, fact)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Error().Err(err).Msg("GetSingleFact")
|
||||||
return findAlias(p.db, fact)
|
return findAlias(p.db, fact)
|
||||||
}
|
}
|
||||||
return true, f
|
return true, f
|
||||||
|
@ -465,7 +466,6 @@ func (p *FactoidPlugin) register() {
|
||||||
|
|
||||||
log.Debug().Msgf("Message: %+v", r)
|
log.Debug().Msgf("Message: %+v", r)
|
||||||
|
|
||||||
// This plugin has no business with normal messages
|
|
||||||
if !message.Command {
|
if !message.Command {
|
||||||
// look for any triggers in the db matching this message
|
// look for any triggers in the db matching this message
|
||||||
return p.trigger(c, message)
|
return p.trigger(c, message)
|
||||||
|
|
Loading…
Reference in New Issue