apierror

package
Version: v0.0.0-...-da7c727 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 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

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto