Documentation
¶
Index ¶
- func IsRetryableError(err error) bool
- func OperationError(err error, operation string, format string, args ...interface{}) error
- func OperationInternal(operation string, err error, format string, args ...interface{}) error
- func OperationInvalidInput(operation string, format string, args ...interface{}) error
- func OperationNotFound(operation string, resourceType string, id string) error
- func WithDetails(err error, details map[string]interface{}) error
- func WrapAsRetryable(err error, attempts, maxAttempts int, retryAfter int64) error
- func WrapWithOperation(err error, operation string, format string, args ...interface{}) error
- type RetryableError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRetryableError ¶
IsRetryableError checks if an error is a retryable error
func OperationError ¶
OperationError wraps an error with operation-specific context
func OperationInternal ¶
OperationInternal creates an internal error for an operation
func OperationInvalidInput ¶
OperationInvalidInput creates an invalid input error for an operation
func OperationNotFound ¶
OperationNotFound creates a not found error for an operation
func WithDetails ¶
WithDetails adds details to an error.
func WrapAsRetryable ¶
WrapAsRetryable wraps an error as retryable
Types ¶
type RetryableError ¶
type RetryableError struct {
Original error
Attempts int
MaxAttempts int
RetryAfter int64 // milliseconds
}
RetryableError wraps an error with retryable context. This error type is used to indicate that an error should be retried by external systems. It is different from RetryError in the infra package, which is used internally by the retry package to indicate that all retry attempts have been exhausted.
func NewRetryableError ¶
func NewRetryableError(err error, attempts, maxAttempts int, retryAfter int64) *RetryableError
NewRetryableError creates a new retryable error
func (*RetryableError) Error ¶
func (e *RetryableError) Error() string
Error returns the error message
func (*RetryableError) IsRetryable ¶
func (e *RetryableError) IsRetryable() bool
IsRetryable returns true if the error is retryable
func (*RetryableError) Unwrap ¶
func (e *RetryableError) Unwrap() error
Unwrap returns the original error