Documentation
¶
Index ¶
- Constants
- func ThrowClientErrorException(code string, status http.StatusCode, payload api.Payload, ...)
- func ThrowException(code string, status http.StatusCode, message string, errorMessage string)
- func ThrowValidationException(code string, message string, errorBag shark.ErrorBag)
- 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 ClientErrorException
- type ClientException
- type Exception
- type GenericException
- type GlobalException
- type RoutineException
- type ValidationException
Constants ¶
const GENERAL string = "GENERAL_ERROR"
GENERAL is default status code
Variables ¶
This section is empty.
Functions ¶
func ThrowClientErrorException ¶ added in v0.1.3
func ThrowClientErrorException(code string, status http.StatusCode, payload api.Payload, headers ...api.ResponseHeader)
ThrowClientErrorException panic with an client error exception object filled with given data
func ThrowException ¶ added in v0.1.2
func ThrowException(code string, status http.StatusCode, message string, errorMessage string)
ThrowException panic with an exception object filled with given data
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 ClientErrorException ¶ added in v0.1.3
type ClientErrorException struct {
// contains filtered or unexported fields
}
Exception is an exception for fatal error happened in runtime
func (ClientErrorException) GetCode ¶ added in v0.1.3
func (e ClientErrorException) GetCode() string
GetCode returns exception code
func (ClientErrorException) GetHeaders ¶ added in v0.1.3
func (e ClientErrorException) GetHeaders() []api.ResponseHeader
GetHeaders returns headers for client error response
func (ClientErrorException) GetMessage ¶ added in v0.1.3
func (e ClientErrorException) GetMessage() string
GetMessage returns exception end user readable Message
func (ClientErrorException) GetPayload ¶ added in v0.1.3
func (e ClientErrorException) GetPayload() api.Payload
GetPayload returns payload of client error response
func (ClientErrorException) GetStatus ¶ added in v0.1.3
func (e ClientErrorException) GetStatus() http.StatusCode
GetStatus returns http status code
type ClientException ¶ added in v0.1.3
type ClientException interface {
GlobalException
// GetPayload returns payload of client error response
GetPayload() api.Payload
// GetHeaders returns headers for client error response
GetHeaders() []api.ResponseHeader
}
ClientException is an interface for any client Exceptions
type Exception ¶
type Exception struct {
// contains filtered or unexported fields
}
Exception is an exception for fatal error happened in runtime
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 {
GlobalException
// 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 server Exceptions
type GlobalException ¶ added in v0.1.3
type GlobalException interface {
// GetCode returns exception code
GetCode() string
// GetStatus returns http status code
GetStatus() http.StatusCode
// GetMessage returns exception end user readable Message
GetMessage() string
}
GlobalException 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