yoake/internal/echoerror/httperror.go

24 lines
308 B
Go
Raw Normal View History

2022-11-11 16:15:22 -06:00
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}
}