package errhandler import ( "context" "git.wishpal.cn/wishpal_ironfan/xframe/component/logger" "github.com/hibiken/asynq" ) type ErrorHandler struct { } func (h ErrorHandler) HandleError(ctx context.Context, task *asynq.Task, err error) { logger.WithContext(ctx).Errorf("asynq task failed, task type: %s, payload: %s, error: %v", task.Type(), task.Payload(), err) }