Documentation ¶
Index ¶
- type AppError
- func (e *AppError) AppendCause() Fault
- func (e *AppError) Cause() error
- func (e *AppError) Causes() []error
- func (e *AppError) Data() map[string]interface{}
- func (e *AppError) Error() string
- func (e *AppError) Retryable() bool
- func (e *AppError) SetCause(cause error) Fault
- func (e *AppError) SetRetryable() Fault
- func (e *AppError) SetSource(s string) Fault
- func (e *AppError) Source() string
- func (e *AppError) ToMessageAwareFault(i18nBundle *i18n.Bundle) MessageAwareFault
- type AppErrorMessage
- type BasicAppError
- func (e *BasicAppError) Code() ErrorCode
- func (p *BasicAppError) Component() ErrComponent
- func (e *BasicAppError) Error() string
- func (p *BasicAppError) ResponseErrType() ResponseErrType
- func (p *BasicAppError) SetComponent(component ErrComponent) BasicFault
- func (p *BasicAppError) SetResponseType(reponse ResponseErrType) BasicFault
- func (e *BasicAppError) ToFault(data map[string]any, cause error) Fault
- type BasicFault
- type BasicFaultsCache
- type ErrComponent
- type ErrorCode
- type Fault
- type MessageAwareFault
- type ResponseErrType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppError ¶
type AppError struct { BasicAppError // contains filtered or unexported fields }
Record not found for email = {{.email}} data[string]any={"email":"your@email.com"}
func (*AppError) AppendCause ¶
AppendCause will append the error cause to the err string
func (*AppError) SetRetryable ¶
func (*AppError) ToMessageAwareFault ¶
func (e *AppError) ToMessageAwareFault(i18nBundle *i18n.Bundle) MessageAwareFault
type AppErrorMessage ¶
type AppErrorMessage struct { AppError // contains filtered or unexported fields }
func (*AppErrorMessage) ErrorString ¶
func (e *AppErrorMessage) ErrorString() string
func (*AppErrorMessage) Message ¶
func (e *AppErrorMessage) Message(lang string) string
func (*AppErrorMessage) String ¶
func (e *AppErrorMessage) String() string
type BasicAppError ¶
type BasicAppError struct {
// contains filtered or unexported fields
}
func (*BasicAppError) Code ¶
func (e *BasicAppError) Code() ErrorCode
func (*BasicAppError) Component ¶
func (p *BasicAppError) Component() ErrComponent
func (*BasicAppError) Error ¶
func (e *BasicAppError) Error() string
func (*BasicAppError) ResponseErrType ¶
func (p *BasicAppError) ResponseErrType() ResponseErrType
func (*BasicAppError) SetComponent ¶
func (p *BasicAppError) SetComponent(component ErrComponent) BasicFault
func (*BasicAppError) SetResponseType ¶
func (p *BasicAppError) SetResponseType(reponse ResponseErrType) BasicFault
type BasicFault ¶
type BasicFault interface { error ResponseErrType() ResponseErrType SetResponseType(r ResponseErrType) BasicFault Component() ErrComponent SetComponent(c ErrComponent) BasicFault Code() ErrorCode ToFault(data map[string]any, cause error) Fault }
func NewBasicFault ¶
func NewBasicFault( code ErrorCode, ) BasicFault
type BasicFaultsCache ¶
type BasicFaultsCache struct {
// contains filtered or unexported fields
}
func NewBasicFaultCache ¶
func NewBasicFaultCache(partialFaults map[ErrorCode]BasicFault) BasicFaultsCache
func (*BasicFaultsCache) AppendBasicFaults ¶
func (fc *BasicFaultsCache) AppendBasicFaults(bfaults map[ErrorCode]BasicFault)
func (*BasicFaultsCache) GetBasicFault ¶
func (p *BasicFaultsCache) GetBasicFault(code ErrorCode) BasicFault
func (*BasicFaultsCache) GetBasicFaults ¶
func (fc *BasicFaultsCache) GetBasicFaults() map[ErrorCode]BasicFault
func (*BasicFaultsCache) IsEmpty ¶
func (fc *BasicFaultsCache) IsEmpty() bool
func (*BasicFaultsCache) Size ¶
func (fc *BasicFaultsCache) Size() int
type ErrComponent ¶
type ErrComponent string
type Fault ¶
type Fault interface { BasicFault Cause() error Causes() []error Data() map[string]interface{} Source() string SetSource(s string) Fault Retryable() bool SetRetryable() Fault AppendCause() Fault SetCause(cause error) Fault ToMessageAwareFault(*i18n.Bundle) MessageAwareFault }
Env {{.var}} var not found
{ "var": "db_name" }
type MessageAwareFault ¶
type MessageAwareFault interface { Fault Message(lang string) string String() string ErrorString() string }
Message Aware Fault will be responsible getting errors, message and localization of message.
type ResponseErrType ¶
type ResponseErrType string
Click to show internal directories.
Click to hide internal directories.