Changing How Errors Are Handled
Logging
import (
"github.com/getsentry/sentry-go"
"github.com/mavolin/adam/pkg/errors"
log "github.com/sirupsen/logrus"
)
func changeLogging() {
errors.Log = func(err error, ctx *plugin.Context) {
log.WithFields(log.Fields{
"err": err,
"cmd_id": ctx.InvokedCommand.ID,
}).
Error("internal error in command")
sentry.CaptureException(err)
}
}Embeds
Type-Specific Handling
Individual handling
Last updated
Was this helpful?