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
Copy file name to clipboardExpand all lines: README.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -248,6 +248,16 @@ The `ReconcileResult` that is passed into the status updater is expected to cont
248
248
- If this is non-nil, it must not point to the same instance as `Object` - use the `DeepCopy()` function to create a different instance.
249
249
- All changes to `Object`'s status that are not part to `OldObject`'s status will be included in the patch during the status update. This can be used to inject custom changes to the status into the status update (in addition to the `WithCustomUpdateFunc` mentioned above).
250
250
251
+
### errors
252
+
253
+
The `errors` package contains the `ReasonableError` type, which combines a normal `error` with a reason string. This is useful for errors that happen during reconciliation for updating the resource's status with a reason for the error later on.
254
+
255
+
#### Noteworthy Functions:
256
+
257
+
-`WithReason(...)` can be used to wrap a standard error together with a reason into a `ReasonableError`.
258
+
-`Errorf(...)` can be used to wrap an existing `ReasonableError` together with a new error, similarly to how `fmt.Errorf(...)` does it for standard errors.
259
+
-`NewReasonableErrorList(...)` or `Join(...)` can be used to work with lists of errors. `Aggregate()` turns them into a single error again.
260
+
251
261
### logging
252
262
253
263
This package contains the logging library from the [Landscaper controller-utils module](https://github.com/gardener/landscaper/tree/master/controller-utils/pkg/logging).
0 commit comments