M shared/http/error.go →
shared/http/error.go cause error
}
+func NewError(message string, code int) httpError {
+ return httpError{
+ code: code,
+ message: message,
+ }
+}
+
func (e httpError) Error() string {
if e.message == "" {
e.message = http.StatusText(e.code)
func (e httpError) Unwrap() error {
return e.cause
-}
-
-func NewError(message string, code int) httpError {
- return httpError{
- code: code,
- message: message,
- }
}
func (e httpError) WithCause(cause error) Error {