Documentation
¶
Index ¶
- func ParseCloudError(raw string) (code string, message string, requestID string)
- func WithActions(source error, actions []Action) error
- func WithDetails(source error, options ...Option) error
- type Action
- type AppError
- type Category
- type ErrorPayload
- type Option
- func WithAcceptedValues(values ...string) Option
- func WithActionsOption(actions ...Action) Option
- func WithCurrentState(state string) Option
- func WithDetail(detail string) Option
- func WithExpectedStates(states ...string) Option
- func WithField(field string) Option
- func WithRawCause(code, message string) Option
- func WithRequestID(requestID string) Option
- func WithSuggestedAction(action string) Option
- func WithSuggestion(suggestion string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseCloudError ¶
func WithActions ¶
func WithDetails ¶
Types ¶
type Action ¶
type Action struct {
RequestID string `json:"request_id,omitempty"`
ActionName string `json:"action_name"`
Code string `json:"code,omitempty"`
Message string `json:"message,omitempty"`
}
func ActionFromError ¶
type AppError ¶
type AppError struct {
// contains filtered or unexported fields
}
func (*AppError) Payload ¶
func (e *AppError) Payload() ErrorPayload
type ErrorPayload ¶
type ErrorPayload struct {
Kind string `json:"kind"`
Code string `json:"code"`
Message string `json:"message"`
Retryable bool `json:"retryable"`
Suggestion string `json:"suggestion,omitempty"`
SuggestedAction string `json:"suggested_action,omitempty"`
Detail string `json:"detail,omitempty"`
Field string `json:"field,omitempty"`
AcceptedValues []string `json:"accepted_values,omitempty"`
CurrentState string `json:"current_state,omitempty"`
ExpectedStates []string `json:"expected_states,omitempty"`
}
type Option ¶
type Option func(*AppError)
func WithAcceptedValues ¶
func WithActionsOption ¶
func WithCurrentState ¶
func WithDetail ¶ added in v0.1.2
func WithExpectedStates ¶
func WithRawCause ¶
func WithRequestID ¶
func WithSuggestedAction ¶
func WithSuggestion ¶
Click to show internal directories.
Click to hide internal directories.