error

package
v0.0.0-...-d691e2b Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package error

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsErrorMessage

type AwsErrorMessage struct {
	ErrorMessage string `json:"errorMessage"`
}

AwsErrorMessage Example:

{
   "errorMessage": "2018-05-10T06:42:59.753Z 5f46a493-541d-11e8-a58a-ed2562190b91 Task timed out after 3.00 seconds"
}

func (*AwsErrorMessage) String

func (m *AwsErrorMessage) String() string

type AwsMessage

type AwsMessage struct {
	Message string `json:"message"`
}

AwsMessage Example:

{
   "message": "The security token included in the request is invalid."
}

type BasicError

type BasicError struct {
	Code    ErrorType `json:"Code,omitempty"`
	Cause   string    `json:"Cause,omitempty"`
	Message string    `json:"Message"`
	Status  int       `json:"Status,omitempty"`
	Type    string    `json:"Type,omitempty"`
}

BasicError struct

func (BasicError) Error

func (err BasicError) Error() string

Error struct compatible with standard `error` interface

type ErrorType

type ErrorType string

ErrorType is the alias of string

const (
	// ResourceNotFoundException = The resource (for example, a function or access policy
	// statement) specified in the request does not exist.
	ResourceNotFoundException ErrorType = "ResourceNotFoundException"
	UserNotFoundException     ErrorType = "UserNotFoundException"

	// TooManyRequestsException xxx
	TooManyRequestsException ErrorType = "TooManyRequestsException"

	// External error face to user
	InvalidParameterValueException ErrorType = "InvalidParameterValueException"
	InvalidRequestContentException ErrorType = "InvalidRequestContentException"
	PolicyLengthExceededException  ErrorType = "PolicyLengthExceededException"
	ServiceException               ErrorType = "ServiceException"
	UnrecognizedClientException    ErrorType = "UnrecognizedClientException"
	UnsupportedMediaTypeException  ErrorType = "UnsupportedMediaTypeException"
	ValidationException            ErrorType = "ValidationException"

	// service defined error
	NotImplementedException      ErrorType = "NotImplementedException"
	RequestTimeoutException      ErrorType = "RequestTimeoutException"
	AccountProblemException      ErrorType = "AccountProblemException"
	InvalidInvokeCallerException ErrorType = "InvalidInvokeCallerException"
)

Error types is the brief introduction of error types, and it's the key to navigate the message below.

const (
	// InvalidRuntimeException = The runtime or runtime version specified is not supported.
	InvalidRuntimeException ErrorType = "InvalidRuntimeException"
)

type FinalError

type FinalError struct {
	BasicError
	Backtrace []BasicError `json:"Backtrace,omitempty"`
}

FinalError preserve the error stack

func GenericKunFinalError

func GenericKunFinalError(err error) FinalError

func NewAccountProblemException

func NewAccountProblemException(cause string, lasterr error) FinalError

NewAccountProblemException xxx

func NewGenericException

func NewGenericException(err BasicError, lasterr error) FinalError

NewGenericException xxx

func NewInvalidInvokeCallerException

func NewInvalidInvokeCallerException(cause string, lasterr error) FinalError

NewInvalidInvokeCallerException xxx

func NewInvalidParameterValueException

func NewInvalidParameterValueException(cause string, lasterr error) FinalError

NewInvalidParameterValueException xxx

func NewInvalidRequestContentException

func NewInvalidRequestContentException(cause string, lasterr error) FinalError

NewInvalidRequestContentException xxx

func NewInvalidRuntimeException

func NewInvalidRuntimeException(cause string, lasterr error) FinalError

NewInvalidRuntimeException creates a InvalidRuntimeException HTTP status code is StatusBadGateway (502)

func NewNotImplementedException

func NewNotImplementedException() FinalError

NewNotImplementedException xxx

func NewRequestTimeoutException

func NewRequestTimeoutException(cause string, timeout time.Duration, lasterr error) FinalError

NewRequestTimeoutException xxx

func NewResourceNotFoundException

func NewResourceNotFoundException(cause string, lasterr error) FinalError

func NewServiceException

func NewServiceException(cause string, lasterr error) FinalError

NewServiceException xxx

func NewTooManyRequestsException

func NewTooManyRequestsException(cause string, lasterr error) FinalError

NewTooManyRequestsException xxx

func NewUnrecognizedClientException

func NewUnrecognizedClientException(cause string, lasterr error) FinalError

NewUnrecognizedClientException creates a UnrecognizedClientException HTTP status code is StatusForbidden (403)

func NewValidationException

func NewValidationException(cause, message string, lasterr error) FinalError

NewValidationException xxx

func (FinalError) Error

func (f FinalError) Error() string

func (FinalError) MarshalJSON

func (f FinalError) MarshalJSON() ([]byte, error)

MarshalJSON xxx

func (FinalError) WithErrorLog

func (err FinalError) WithErrorLog() FinalError

WithErrorLog xxx

func (FinalError) WithWarnLog

func (err FinalError) WithWarnLog() FinalError

WithWarnLog xxx

func (FinalError) WriteTo

func (err FinalError) WriteTo(w http.ResponseWriter) FinalError

WriteTo xxx

Jump to

Keyboard shortcuts

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