[respond] Log message template errors even when fallback is set

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-10-22 00:02:18 +02:00
parent edd90bb293
commit 0f5dc7ba8e
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D

View file

@ -7,6 +7,7 @@ import (
"github.com/Luzifer/twitch-bot/plugins"
"github.com/go-irc/irc"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
)
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) == "" {
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 {
return false, errors.Wrap(err, "preparing response fallback")
}