server-go/web/error.go
2018-08-22 17:37:12 +09:00

26 lines
320 B
Go

package web
import (
ouc "git.loafle.net/overflow/util-go/ctx"
)
const (
ErrorKey = ouc.CtxtKey("ErrorKey")
)
func NewError(code int, cause error) *Error {
return &Error{
Code: code,
Cause: cause,
}
}
type Error struct {
Code int
Cause error
}
func (e *Error) Error() string {
return e.Cause.Error()
}