Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AgentError ¶
AgentError Agent 自定义错误
func WrapError ¶
func WrapError(code ErrorCode, message string, err error) *AgentError
WrapError 包装现有错误
func (*AgentError) Error ¶
func (e *AgentError) Error() string
func (*AgentError) Unwrap ¶
func (e *AgentError) Unwrap() error
type ErrorCode ¶
type ErrorCode string
ErrorCode 错误代码类型
const ( // 通用错误 ErrCodeUnknown ErrorCode = "UNKNOWN" ErrCodeInvalidRequest ErrorCode = "INVALID_REQUEST" ErrCodeNotFound ErrorCode = "NOT_FOUND" ErrCodeInternal ErrorCode = "INTERNAL_ERROR" // 服务相关错误 ErrCodeServiceNotFound ErrorCode = "SERVICE_NOT_FOUND" ErrCodeServiceNotRunning ErrorCode = "SERVICE_NOT_RUNNING" ErrCodeServiceAlreadyRunning ErrorCode = "SERVICE_ALREADY_RUNNING" ErrCodeServiceStartFailed ErrorCode = "SERVICE_START_FAILED" ErrCodeServiceStopFailed ErrorCode = "SERVICE_STOP_FAILED" // 健康检查相关错误 ErrCodeHealthCheckFailed ErrorCode = "HEALTH_CHECK_FAILED" ErrCodeHealthCheckTimeout ErrorCode = "HEALTH_CHECK_TIMEOUT" // 配置相关错误 ErrCodeConfigInvalid ErrorCode = "CONFIG_INVALID" ErrCodeConfigNotFound ErrorCode = "CONFIG_NOT_FOUND" )
Click to show internal directories.
Click to hide internal directories.