cerrors

package
v0.0.0-...-7e08c69 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsUserFriendly

func IsUserFriendly(err error) bool

IsUserFriendly returns true if err is marked as safe to present to failstep

Types

type Error

type Error struct {
	Source    string    `json:"source,omitempty"`
	ErrorCode ErrorType `json:"errorCode,omitempty"`
	Phase     string    `json:"phase,omitempty"`
	Reason    string    `json:"reason,omitempty"`
	Target    string    `json:"target,omitempty"`
}

func (Error) Error

func (e Error) Error() string

func (Error) ErrorType

func (e Error) ErrorType() ErrorType

func (Error) UserFriendly

func (e Error) UserFriendly() bool

type ErrorType

type ErrorType string
const (
	ErrorTypeNonUserFriendly   ErrorType = "NON_USER_FRIENDLY_ERROR"
	ErrorTypeGeneric           ErrorType = "GENERIC_ERROR"
	ErrorTypeChaosResultCRUD   ErrorType = "CHAOS_RESULT_CRUD_ERROR"
	ErrorTypeStatusChecks      ErrorType = "STATUS_CHECKS_ERROR"
	ErrorTypeTargetSelection   ErrorType = "TARGET_SELECTION_ERROR"
	ErrorTypeExperimentAborted ErrorType = "EXPERIMENT_ABORTED"
	ErrorTypeHelper            ErrorType = "HELPER_ERROR"
	ErrorTypeHelperPodFailed   ErrorType = "HELPER_POD_FAILED_ERROR"
	ErrorTypeContainerRuntime  ErrorType = "CONTAINER_RUNTIME_ERROR"
	ErrorTypeChaosInject       ErrorType = "CHAOS_INJECT_ERROR"
	ErrorTypeChaosRevert       ErrorType = "CHAOS_REVERT_ERROR"
	ErrorTypeK8sProbe          ErrorType = "K8S_PROBE_ERROR"
	FailureTypeK8sProbe        ErrorType = "K8S_PROBE_FAILURE"
	ErrorTypeCmdProbe          ErrorType = "CMD_PROBE_ERROR"
	FailureTypeCmdProbe        ErrorType = "CMD_PROBE_FAILURE"
	ErrorTypeHttpProbe         ErrorType = "HTTP_PROBE_ERROR"
	FailureTypeHttpProbe       ErrorType = "HTTP_PROBE_FAILURE"
	ErrorTypePromProbe         ErrorType = "PROM_PROBE_ERROR"
	FailureTypePromProbe       ErrorType = "PROM_PROBE_FAILURE"
	ErrorTypeTimeout           ErrorType = "TIMEOUT"
	FailureTypeProbeTimeout    ErrorType = "PROBE_TIMEOUT"
)

func GetErrorType

func GetErrorType(err error) ErrorType

GetErrorType returns the type of error if the error is user-friendly

func GetRootCauseAndErrorCode

func GetRootCauseAndErrorCode(err error, phase string) (string, ErrorType)

type PreserveError

type PreserveError struct {
	ErrString string
}

func (PreserveError) Error

func (pe PreserveError) Error() string

func (PreserveError) ErrorType

func (pe PreserveError) ErrorType() ErrorType

func (PreserveError) UserFriendly

func (pe PreserveError) UserFriendly() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL