// Package connecterrors holds error sentinels shared between the // Stripe Connect HTTP client (internal/services) and the marketplace // reversal worker (internal/core/marketplace). Neither of those // packages can directly export a sentinel the other references without // creating an import cycle (marketplace → monitoring → services), so // the sentinels live here as a leaf package that depends on nothing // and is depended on by both. // // Scope is intentionally narrow: only errors that the worker routes on // via errors.Is live here. Generic Stripe errors remain wrapped raw // by the service and treated as transient retry candidates by the // worker. A new sentinel lands here only when the worker needs to // branch on it differently from the transient case. package connecterrors import "errors" // ErrTransferAlreadyReversed indicates the Stripe transfer has already // been fully reversed out-of-band (via the Dashboard, another // instance, or a prior worker tick that lost the response). Benign — // the worker treats this as reversal success and flips the row to // reversed with a distinctive error_message. var ErrTransferAlreadyReversed = errors.New("stripe transfer already reversed") // ErrTransferNotFound indicates the Stripe transfer id doesn't exist // at Stripe. This is a data-integrity incident (our DB carries an id // Stripe can't recognise), not a retry scenario. The worker // terminates the row as permanently_failed and surfaces it for ops // investigation — never retries, which would amplify the // inconsistency. var ErrTransferNotFound = errors.New("stripe transfer not found")