server-go/web/error.go

26 lines
320 B
Go
Raw Permalink Normal View History

2018-08-22 08:37:12 +00:00
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()
}