MCPcopy
hub / github.com/rclone/rclone / ContextError

Function ContextError

fs/fserrors/error.go:452–460  ·  view source on GitHub ↗

ContextError checks to see if ctx is in error. If it is in error then it overwrites *perr with the context error if *perr was nil and returns true. Otherwise it returns false.

(ctx context.Context, perr *error)

Source from the content-addressed store, hash-verified

450//
451// Otherwise it returns false.
452func ContextError(ctx context.Context, perr *error) bool {
453 if ctxErr := ctx.Err(); ctxErr != nil {
454 if *perr == nil {
455 *perr = ctxErr
456 }
457 return true
458 }
459 return false
460}

Callers 15

shouldRetryFunction · 0.92
shouldRetryFunction · 0.92
waitForJobMethod · 0.92
deleteMethod · 0.92
copyOrMoveMethod · 0.92
shouldRetryMethod · 0.92
shouldRetryFunction · 0.92
shouldRetryFunction · 0.92
shouldRetryFunction · 0.92
shouldRetryMethod · 0.92
shouldRetryFunction · 0.92
shouldRetryFunction · 0.92

Calls 1

ErrMethod · 0.45

Tested by 1

TestContextErrorFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…