mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-08 16:20:02 +00:00
[respond] Log message template errors even when fallback is set
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
edd90bb293
commit
0f5dc7ba8e
1 changed files with 2 additions and 0 deletions
|
@ -7,6 +7,7 @@ import (
|
||||||
"github.com/Luzifer/twitch-bot/plugins"
|
"github.com/Luzifer/twitch-bot/plugins"
|
||||||
"github.com/go-irc/irc"
|
"github.com/go-irc/irc"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
const actorName = "respond"
|
const actorName = "respond"
|
||||||
|
@ -79,6 +80,7 @@ func (a actor) Execute(c *irc.Client, m *irc.Message, r *plugins.Rule, eventData
|
||||||
if !attrs.CanString("fallback") || attrs.MustString("fallback", nil) == "" {
|
if !attrs.CanString("fallback") || attrs.MustString("fallback", nil) == "" {
|
||||||
return false, errors.Wrap(err, "preparing response")
|
return false, errors.Wrap(err, "preparing response")
|
||||||
}
|
}
|
||||||
|
log.WithError(err).Error("Response message processing caused error, trying fallback")
|
||||||
if msg, err = formatMessage(attrs.MustString("fallback", nil), m, r, eventData); err != nil {
|
if msg, err = formatMessage(attrs.MustString("fallback", nil), m, r, eventData); err != nil {
|
||||||
return false, errors.Wrap(err, "preparing response fallback")
|
return false, errors.Wrap(err, "preparing response fallback")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue