Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( UnknownError = NewAppError( "UnknownError", "", 0, http.StatusTeapot, ) ErrInternalServerError = NewAppError( "InternalServerError", "internal server error", 1, http.StatusBadRequest) ErrSQLExec = NewAppError( "SQLError", "SQL execution error", 2, http.StatusInternalServerError) ErrNotFound = NewAppError( "NotFound", "entity not found", 3, http.StatusNotFound) ErrValidationError = NewAppError( "ValidationError", "validation error", 4, http.StatusBadRequest) ErrParseError = NewAppError( "ParseError", "parse error", 5, http.StatusBadRequest) ErrNoAuthorizationHeader = NewAppError( "NoAuthorizationHeader", "no authorization header", 6, http.StatusUnauthorized) ErrWrongToken = NewAppError( "WrongToken", "wrong token", 7, http.StatusUnauthorized) )
Functions ¶
func IsNotFound ¶
Types ¶
type AppError ¶
type AppError struct { // Наименование ошибки Name string `json:"name" validate:"required" example:"NotFound"` // Сообщение ошибки Message string `json:"message" validate:"required" example:"entity not found"` // Код ошибки Code int `json:"code" validate:"required" example:"26002"` // Статус код ответа Status int `json:"status" validate:"required" example:"404"` // Начальная ошибка InternalError error `json:"-"` // Нужно ли логировать ошибку в миддлваре IsNotLogging bool `json:"-"` } // @AppError
func NewAppError ¶
func (AppError) DisableLog ¶
func (AppError) SetMessage ¶
func (AppError) ToCoreError ¶
Click to show internal directories.
Click to hide internal directories.