Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CodeForError ¶
func IsInternalError ¶
func IsNotFound ¶
func IsTooManyRequests ¶
Types ¶
type CauseType ¶
type CauseType string
const ( StorageMethodCall CauseType = "call etcd storage method error" Marshal CauseType = "marshal error" Unmarshal CauseType = "unmarshal error" AgentStepInstall CauseType = "agent install step command " AgentStepUninstall CauseType = "agent uninstall step command" ShellCommand CauseType = "shell command step error" StepLog CauseType = "step log error" )
type StatusCause ¶
type StatusCause struct { Type CauseType `json:"reason,omitempty"` Message string `json:"message,omitempty"` }
func StatusErrorCause ¶
func StatusErrorCause(err error, name CauseType) (StatusCause, bool)
type StatusDetails ¶
type StatusDetails struct { AgentID string `json:"agent_id,omitempty"` Subject string `json:"subject,omitempty"` Operation int32 `json:"operation,omitempty"` Causes []StatusCause `json:"causes,omitempty"` }
type StatusError ¶
type StatusError struct { Message string `json:"message,omitempty"` Reason StatusReason `json:"reason,omitempty"` Details *StatusDetails `json:"details,omitempty"` // Status number, 0 if not set. Code int32 `json:"code,omitempty"` }
func (*StatusError) Error ¶
func (s *StatusError) Error() string
type StatusReason ¶
type StatusReason string
const ( StatusReasonUnknown StatusReason = "" StatusReasonStorageMethodCall StatusReason = "call etcd storage method error" StatusReasonUnexpected StatusReason = "unexpected error" )
Click to show internal directories.
Click to hide internal directories.