server-go/web/error.go
crusader 153a9768db ing
2018-04-06 14:50:20 +09:00

26 lines
326 B
Go

package web
import (
cuc "git.loafle.net/commons/util-go/context"
)
const (
ErrorKey = cuc.ContextKey("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()
}