package queue import ( "context" "github.com/riverqueue/river" "github.com/riverqueue/river/rivertype" logrus "github.com/sirupsen/logrus" ) type CustomErrorHandler struct{} func (*CustomErrorHandler) HandleError(_ context.Context, _ *rivertype.JobRow, err error) *river.ErrorHandlerResult { logrus.Infof("Job errored with: %s\n", err) return nil } func (*CustomErrorHandler) HandlePanic(_ context.Context, _ *rivertype.JobRow, panicVal any, trace string) *river.ErrorHandlerResult { logrus.Infof("Job panicked with: %v\n", panicVal) logrus.Infof("Stack trace: %s\n", trace) return &river.ErrorHandlerResult{ SetCancelled: true, } }