Documentation ¶
Index ¶
Constants ¶
View Source
const ( ErrorPrefix = "errors.qilin.store." ServicePrefix = "ST" HTTPStatusInvalidSession = 474 )
Variables ¶
View Source
var ( InternalError = NewError(1001, "internal_error", http.StatusInternalServerError) AccessForbidden = NewError(1002, "access_forbidden", http.StatusForbidden) MethodNotAllowed = NewError(1005, "method_not_allowed", http.StatusMethodNotAllowed) NotFound = NewError(1006, "not_found", http.StatusNotFound) AuthCodeExchangeFail = NewError(1008, "auth_code_exchange_failed", http.StatusBadRequest) IdTokenNotProvided = NewError(1009, "id_token_not_provided", http.StatusBadRequest) IdTokenVerificationFail = NewError(1010, "id_token_verification_fail", http.StatusBadRequest) NotRegistered = NewError(1011, "not_registered", http.StatusBadRequest) SessionSetFailed = NewError(1012, "failed_to_set_session", http.StatusInternalServerError) UnhandledPanic = NewError(1013, "unhandled_panic", http.StatusInternalServerError) InvalidSession = NewError(1015, "invalid_session", HTTPStatusInvalidSession) PasswordMismatch = NewError(1016, "password_mismatch", http.StatusBadRequest) )
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct { Code string `json:"code"` Message string `json:"error"` Status int `json:"-"` Param string `json:"param,omitempty"` Data interface{} `json:"data,omitempty"` }
func GQLClientError ¶
func InvalidParameters ¶
func InvalidRequest ¶
func RecoveredPanic ¶
type ErrorHandler ¶
type ErrorHandler struct {
// contains filtered or unexported fields
}
func New ¶
func New() *ErrorHandler
func (*ErrorHandler) Handler ¶
func (h *ErrorHandler) Handler(err error, ctx echo.Context)
ErrorHandler represents echo error handler for api
func (*ErrorHandler) Middleware ¶
func (h *ErrorHandler) Middleware() echo.MiddlewareFunc
Click to show internal directories.
Click to hide internal directories.