Documentation
¶
Index ¶
Constants ¶
View Source
const ( InternalServerError = "internal server error" BadRequest = "bad request" NotFound = "not_found" InvalidDataCode = 402 ForbiddenErrorCode = 403 InternalServerErrorCode = 500 NotFoundErrorCode = 404 )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AppError ¶
type AppError struct {
Code int `json:"code"` // HTTP статус код
Message string `json:"message"` // Сообщение для клиента
Err error `json:"-"` // Внутренняя ошибка, не для клиента
IsUserFacing bool `json:"-"` // Флаг, указывающий, можно ли показывать `Err`
}
AppError представляет собой стандартизированную структуру ошибки для API
func NewAppError ¶
NewAppError создает новый экземпляр AppError
Click to show internal directories.
Click to hide internal directories.