Documentation
¶
Index ¶
- Constants
- type AggregatedRoutineException
- func (e AggregatedRoutineException) GetCode() string
- func (e AggregatedRoutineException) GetErrorMessage() string
- func (e AggregatedRoutineException) GetMessage() string
- func (e AggregatedRoutineException) GetStatus() http.StatusCode
- func (e AggregatedRoutineException) GetTags() map[string]string
- func (e AggregatedRoutineException) ShouldReport() bool
- type Exception
- type GenericException
- type RoutineException
- type ValidationException
Constants ¶
const GENERAL string = "GENERAL_ERROR"
GENERAL is default status code
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregatedRoutineException ¶
type AggregatedRoutineException struct {
// contains filtered or unexported fields
}
AggregatedRoutineException is aggregate of routine exceptions of a single event
func NewAggregatedRoutineException ¶
func NewAggregatedRoutineException( message string, errorMessage string, code string, status http.StatusCode, errors []RoutineException, ) AggregatedRoutineException
NewAggregatedRoutineException generate an aggregate routine exception
func (AggregatedRoutineException) GetCode ¶
func (e AggregatedRoutineException) GetCode() string
GetCode returns exception code
func (AggregatedRoutineException) GetErrorMessage ¶
func (e AggregatedRoutineException) GetErrorMessage() string
GetErrorMessage returns exception error Message
func (AggregatedRoutineException) GetMessage ¶
func (e AggregatedRoutineException) GetMessage() string
GetMessage returns exception end user readable Message
func (AggregatedRoutineException) GetStatus ¶
func (e AggregatedRoutineException) GetStatus() http.StatusCode
GetStatus returns http status code
func (AggregatedRoutineException) GetTags ¶
func (e AggregatedRoutineException) GetTags() map[string]string
GetTags returns list of informational tags for reporting
func (AggregatedRoutineException) ShouldReport ¶
func (e AggregatedRoutineException) ShouldReport() bool
ShouldReport determine that whether the panic should be reported
type Exception ¶
type Exception struct {
// contains filtered or unexported fields
}
Exception is an exception for fatal error happened in runtime
func NewException ¶
func NewException(code string, status http.StatusCode, message string, errorMessage string) Exception
NewException generates new exception object with given data
func (Exception) GetErrorMessage ¶
GetErrorMessage returns exception error Message
func (Exception) GetMessage ¶
GetMessage returns exception end user readable Message
func (Exception) GetStatus ¶
func (e Exception) GetStatus() http.StatusCode
GetStatus returns http status code
func (Exception) ShouldReport ¶
ShouldReport determine that whether the panic should be reported By default all exceptions returns true for ShouldReport method
type GenericException ¶
type GenericException interface {
// GetCode returns exception code
GetCode() string
// GetStatus returns http status code
GetStatus() http.StatusCode
// GetMessage returns exception end user readable Message
GetMessage() string
// GetErrorMessage returns exception error Message
GetErrorMessage() string
// ShouldReport determine that whether the panic should be reported
ShouldReport() bool
// GetTags returns list of informational tags for reporting
GetTags() map[string]string
}
GenericException is an interface for any type of Exceptions
type RoutineException ¶
RoutineException is an exception that happened in routines
type ValidationException ¶
type ValidationException struct {
Exception
// contains filtered or unexported fields
}
ValidationException is an exception for validation errors
func (ValidationException) GetErrors ¶
func (e ValidationException) GetErrors() map[string][]string
GetErrors return validation faults map