Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
35 lines (30 loc) · 1.38 KB

File metadata and controls

35 lines (30 loc) · 1.38 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package river
import (
"context"
"github.com/riverqueue/river/rivertype"
)
// ErrorHandler provides an interface that will be invoked in case of an error
// or panic occurring in the job. This is often useful for logging and exception
// tracking, but can also be used to customize retry behavior.
type ErrorHandler interface {
// HandleError is invoked in case of an error occurring in a job.
//
// Context is descended from the one used to start the River client that
// worked the job. Errors are handled above all middleware, so changes made
// to context by a middleware are not available in the context.
HandleError(ctx context.Context, job *rivertype.JobRow, err error) *ErrorHandlerResult
// HandlePanic is invoked in case of a panic occurring in a job.
//
// Context is descended from the one used to start the River client that
// worked the job. Panics are handled above all middleware, so changes made
// to context by a middleware are not available in the context (however,
// panics can be recovered from in any middleware where middleware context
// is available).
HandlePanic(ctx context.Context, job *rivertype.JobRow, panicVal any, trace string) *ErrorHandlerResult
}
type ErrorHandlerResult struct {
// SetCancelled can be set to true to fail the job immediately and
// permanently. By default it'll continue to follow the configured retry
// schedule.
SetCancelled bool
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.