Documentation ¶
Index ¶
- func Cause(err error) error
- func Errorf(format string, args ...interface{}) error
- func New(message string) error
- func NewHttpError(httpCode int, message string) error
- func NewServiceError(serviceErrorCode int, httpCode int, message string) error
- func Wrap(err error, message string) error
- type HTTPError
- type SDKError
- type ServiceError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cause ¶
Cause returns the underlying cause of the error, if possible. An error value has a cause if it implements the following interface:
type causer interface { Cause() error }
If the error does not implement Cause, the original error will be returned. If the error is nil, nil will be returned without further investigation.
func Errorf ¶
Errorf formats according to a format specifier and returns the string as a value that satisfies error. Errorf also records the stack trace at the point it was called.
func NewHttpError ¶
NewHttpError returns an error based on HTTP status code.
func NewServiceError ¶
NewServiceError returns an Service error.
Types ¶
type HTTPError ¶
type HTTPError struct {
// contains filtered or unexported fields
}
HTTPError stores HTTP Status error.
func (HTTPError) HTTPErrorCode ¶
GetCode gets HTTP status code.
type SDKError ¶
type SDKError struct { HTTPError ServiceError Message string }
func ToSdkError ¶
func (SDKError) IsHTTPError ¶
IsHTTPError checks if an error is HTTP status code based error.
func (SDKError) IsServiceError ¶
IsServiceError checks if an error is Service error.
type ServiceError ¶
type ServiceError struct {
// contains filtered or unexported fields
}
ServiceError stores Service errors.
func (ServiceError) ServiceErrorCode ¶
func (serviceError ServiceError) ServiceErrorCode() int
GetCode gets Service error code.