yoake/internal/echoerror/httperror.go
2022-11-11 17:16:53 -05:00

23 lines
308 B
Go

package echoerror
type HTTPError interface {
error
Code() int
}
type httpError struct {
code int
err error
}
func (e *httpError) Error() string {
return e.err.Error()
}
func (e *httpError) Code() int {
return e.code
}
func NewHttp(code int, err error) HTTPError {
return &httpError{code, err}
}