2
0
mirror of https://github.com/hibiken/asynq.git synced 2026-04-07 19:15:51 +08:00

feat (add): panic error handling (#491)

* closes #487
This commit is contained in:
Trịnh Đức Bảo Linh(Kevin)
2023-07-20 20:33:39 +07:00
committed by GitHub
parent 123d560a44
commit 551b0c7119
5 changed files with 85 additions and 3 deletions

View File

@@ -162,6 +162,16 @@ type Config struct {
// })
//
// ErrorHandler: asynq.ErrorHandlerFunc(reportError)
// we can also handle panic error like:
// func reportError(ctx context, task *asynq.Task, err error) {
// if asynq.IsPanic(err) {
// errorReportingService.Notify(err)
// }
// })
//
// ErrorHandler: asynq.ErrorHandlerFunc(reportError)
ErrorHandler ErrorHandler
// Logger specifies the logger used by the server instance.