Documentation ¶
Overview ¶
Package errors - http 처리 상에 발생한 오류 관련 기능 제공 프키지
Package errors -
Index ¶
- Variables
- func Cause(err error) error
- func Errorf(format string, args ...interface{}) error
- func Handler(rw http.ResponseWriter, req *http.Request, err interface{})
- func New(message string) error
- func NotFound(rw http.ResponseWriter, req *http.Request)
- func RecoveryHandler(rw http.ResponseWriter, req *http.Request, err interface{})
- func WithMessage(err error, message string) error
- func WithStack(err error) error
- func Wrap(err error, message string) error
- func Wrapf(err error, format string, args ...interface{}) error
- type Error
- type Frame
- type StackTrace
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrRouteNotFound happens when no route was matched ErrRouteNotFound = NewWithCode(http.StatusNotFound, "no API found with those values") // ErrInvalidID represents an invalid identifier ErrInvalidID = NewWithCode(http.StatusBadRequest, "please provide a valid ID") )
Functions ¶
func Handler ¶
func Handler(rw http.ResponseWriter, req *http.Request, err interface{})
Handler - 오류 정보를 JSON 형식으로 변환
func NotFound ¶
func NotFound(rw http.ResponseWriter, req *http.Request)
NotFound - 조건에 맞는 Router 정보가 없는 경우 오류
func RecoveryHandler ¶
func RecoveryHandler(rw http.ResponseWriter, req *http.Request, err interface{})
RecoveryHandler - Panic이 발생했을 때 처리를 위한 Recovery Handler 반환
func WithMessage ¶
WithMessage - 오류에 지정한 메시지 정보 추가
Types ¶
type Error ¶
Error - error 인터페이스가 적용된 사용자 정의 오류 형식
func NewWithCode ¶
NewWithCode - 지정한 상태 코드와 메시지를 기준으로 오류정보 생성
type Frame ¶
type Frame uintptr
Frame represents a program counter inside a stack frame.
func (Frame) Format ¶
Format formats the frame according to the fmt.Formatter interface.
%s source file %d source line %n function name %v equivalent to %s:%d
Format accepts flags that alter the printing of some verbs, as follows:
%+s path of source file relative to the compile time GOPATH %+v equivalent to %+s:%d
type StackTrace ¶
type StackTrace []Frame
StackTrace is stack of Frames from innermost (newest) to outermost (oldest).
Click to show internal directories.
Click to hide internal directories.