gore

package module
v0.0.0-...-f75815f Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RecoveryHandlerMiddleware

func RecoveryHandlerMiddleware() gin.HandlerFunc

Types

type ErrorCode

type ErrorCode = int
const (
	EntityNotFoundError ErrorCode = 1000 + iota
	EntityValidationError
	EntityUnauthorizedError
	TransactionForbiddenError
	GatewayError
	MethodNotAllowedError
	ServerOverburdenedError
	GatewayTimeoutError
	InternalServalError
	EntityGoneError
	EntityConflictError
)

type ErrorResponse

type ErrorResponse struct {
	StatusCode    int    `json:"-"`
	ErrorCode     int    `json:"errorCode,omitEmpty"`
	ErrorMessage  string `json:"errorMessage,omitEmpty"`
	ErrorDetails  string `json:"errorDetails,omitEmpty"`
	TransactionId string `json:"transactionId,omitEmpty"`
	CorrelationId string `json:"correlationId,omitEmpty"`
	// contains filtered or unexported fields
}

func EntityConflictException

func EntityConflictException(e error, transactionId, correlationId string) *ErrorResponse

func EntityGoneException

func EntityGoneException(e error, transactionId, correlationId string) *ErrorResponse

func EntityNotFoundException

func EntityNotFoundException(e error, transactionId, correlationId string) *ErrorResponse

func EntityUnauthorizedException

func EntityUnauthorizedException(e error, transactionId, correlationId string) *ErrorResponse

func EntityValidationException

func EntityValidationException(e error, transactionId, correlationId string) *ErrorResponse

func GatewayException

func GatewayException(e error, transactionId, correlationId string) *ErrorResponse

func GatewayTimeoutException

func GatewayTimeoutException(e error, transactionId, correlationId string) *ErrorResponse

func InternalServerException

func InternalServerException(e error, transactionId, correlationId string) *ErrorResponse

func MethodNotAllowedException

func MethodNotAllowedException(e error, transactionId, correlationId string) *ErrorResponse

func NewException

func NewException(e error, errorMessage, errorDetails, transactionId, correlationId string, statusCode, errorCoder int) *ErrorResponse

func ServerOverburdenedException

func ServerOverburdenedException(e error, transactionId, correlationId string) *ErrorResponse

func TransactionForbiddenException

func TransactionForbiddenException(e error, transactionId, correlationId string) *ErrorResponse

func (*ErrorResponse) Error

func (err *ErrorResponse) Error() string

func (*ErrorResponse) Unwrap

func (err *ErrorResponse) Unwrap() error

Jump to

Keyboard shortcuts

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