@@ -10,35 +10,32 @@ You may obtain a copy of the License at
1010
1111package cloud
1212
13- import "errors "
13+ import "github.com/stackitcloud/cluster-api-provider-stackit/cloud/services/shared "
1414
15- // Sentinel errors returned by Client implementations. Controllers use
16- // errors.Is to classify them into requeue / condition-update behavior.
15+ // Sentinel errors returned by Client implementations, re-exported from shared.
16+ // Controllers use errors.Is to classify them into requeue / condition-update behavior.
1717var (
18- ErrNotFound = errors . New ( "not found" )
19- ErrUnauthorized = errors . New ( "unauthorized" )
20- ErrInvalidInput = errors . New ( "invalid input" )
21- ErrConflict = errors . New ( "conflict" )
22- ErrTransient = errors . New ( "transient" )
18+ ErrNotFound = shared . ErrNotFound
19+ ErrUnauthorized = shared . ErrUnauthorized
20+ ErrInvalidInput = shared . ErrInvalidInput
21+ ErrConflict = shared . ErrConflict
22+ ErrTransient = shared . ErrTransient
2323)
2424
2525// IsNotFound reports whether err wraps ErrNotFound.
26- func IsNotFound (err error ) bool { return errors . Is (err , ErrNotFound ) }
26+ func IsNotFound (err error ) bool { return shared . IsNotFound (err ) }
2727
2828// IsUnauthorized reports whether err wraps ErrUnauthorized.
29- func IsUnauthorized (err error ) bool { return errors . Is (err , ErrUnauthorized ) }
29+ func IsUnauthorized (err error ) bool { return shared . IsUnauthorized (err ) }
3030
3131// IsInvalidInput reports whether err wraps ErrInvalidInput.
32- func IsInvalidInput (err error ) bool { return errors . Is (err , ErrInvalidInput ) }
32+ func IsInvalidInput (err error ) bool { return shared . IsInvalidInput (err ) }
3333
3434// IsConflict reports whether err wraps ErrConflict.
35- func IsConflict (err error ) bool { return errors . Is (err , ErrConflict ) }
35+ func IsConflict (err error ) bool { return shared . IsConflict (err ) }
3636
3737// IsTransient reports whether err wraps ErrTransient.
38- func IsTransient (err error ) bool { return errors . Is (err , ErrTransient ) }
38+ func IsTransient (err error ) bool { return shared . IsTransient (err ) }
3939
40- // IsRetryable reports whether err should trigger a requeue (conflict or
41- // transient).
42- func IsRetryable (err error ) bool {
43- return IsConflict (err ) || IsTransient (err )
44- }
40+ // IsRetryable reports whether err should trigger a requeue (conflict or transient).
41+ func IsRetryable (err error ) bool { return shared .IsRetryable (err ) }
0 commit comments