apierror

package
v0.0.0-...-391b505 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknown   = NewApiError(502, -10, "서버에 문제가 발생했습니다.")
	ErrDBErr     = NewApiError(http.StatusInternalServerError, -11, "error occur")
	ErrInterface = NewApiError(http.StatusInternalServerError, -12, "err occur")

	ErrLoginFailed    = NewApiError(http.StatusUnauthorized, -100, "이메일 또는 암호가 올바르지 않습니다.")
	ErrInvalidKey     = NewApiError(http.StatusUnauthorized, -101, "bad token")
	ErrEmailNotUnique = NewApiError(http.StatusBadRequest, -102, "이미 존재하는 이메일입니다.")

	ErrFirstParse = NewApiError(http.StatusInternalServerError, -200, "error on first d2u parse")
)

Functions

This section is empty.

Types

type ApiError

type ApiError struct {
	StatusCode int `json:"-"`
	ErrorCode  int
	Message    string
}

func NewApiError

func NewApiError(status int, code int, message string) ApiError

func (ApiError) Error

func (e ApiError) Error() string

func (ApiError) Send

func (e ApiError) Send(c echo.Context) error

type UserRegisterError

type UserRegisterError struct {
	Field   string
	Content string
}

func (UserRegisterError) Error

func (e UserRegisterError) Error() string

func (UserRegisterError) Send

func (e UserRegisterError) Send(c echo.Context) error

Jump to

Keyboard shortcuts

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