You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Non-retryable by default.** A plain `fmt.Errorf(...)` is treated as a non-retryable infra error. Retryability must be explicitly opted into by wrapping with `NewRetryableError`. This prevents accidental infinite retry loops from unclassified errors.
15
+
**Non-retryable by default.** A plain `fmt.Errorf(...)` is treated as a non-retryable infra error. Retryability must be explicitly recognized by a registered classifier or framework wrapper. This prevents accidental infinite retry loops from unclassified errors.
16
16
17
17
**Only infra errors can be retryable.** User errors are never retryable — if a user action caused the failure, retrying the same operation will produce the same result. If an error is retryable, it is by definition an infrastructure issue.
18
18
@@ -58,7 +58,7 @@ Two implementations ship in this package:
58
58
59
59
## Adding a Backend-Specific Classifier
60
60
61
-
Backend classifiers live alongside the extension they classify, under `platform/errs/<backend>/`. The canonical examples are `platform/errs/mysql` (MySQL driver errors) and `platform/errs/generic` (transport-agnostic concerns such as `context.Canceled`).
61
+
Backend classifiers live alongside the extension they classify, under `platform/errs/<backend>/`. The canonical examples are `platform/errs/mysql` (MySQL driver errors) and `platform/errs/generic` (backend-independent errors such as `context.Canceled` and `errs.ErrVersionMismatch`).
62
62
63
63
A classifier:
64
64
@@ -137,7 +137,7 @@ In particular, **do not reach for `NewRetryableError` just because replaying the
137
137
138
138
## Extensions Return Plain Go Errors
139
139
140
-
Extension interfaces (`MergeChecker`, `Storage`, `Publisher`) return standard `error` values. They may define their own domain-specific sentinel errors (e.g. `storage.ErrNotFound`, `storage.ErrVersionMismatch`) but they do **not** classify errors as user or infra — that is the controller's (and the consumer's `ErrorProcessor`'s) job.
140
+
Extension interfaces (`MergeChecker`, `Storage`, `Publisher`) return standard `error` values. They may define domain-specific sentinel errors such as `storage.ErrNotFound` or expose shared semantic sentinels such as `errs.ErrVersionMismatch`, but they do **not** classify errors as user or infra. That is the controller's and the consumer's `ErrorProcessor`'s job.
141
141
142
142
This separation keeps extensions reusable across contexts. The same `storage.ErrNotFound` might be a user error in one controller (user requested a non-existent resource) and an infra error in another (expected record is missing).
0 commit comments