Archived
2
0
This repository has been archived on 2024-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
neko-custom/server/internal/http/endpoint/error.go

18 lines
254 B
Go
Raw Normal View History

2020-01-13 21:05:38 +13:00
package endpoint
import "fmt"
type HandlerError struct {
2020-01-19 12:30:09 +13:00
Status int
Message string
Err error
2020-01-13 21:05:38 +13:00
}
func (e *HandlerError) Error() string {
2020-01-19 12:30:09 +13:00
if e.Err != nil {
return fmt.Sprintf("%s: %s", e.Message, e.Err.Error())
}
2020-01-13 21:05:38 +13:00
2020-01-19 12:30:09 +13:00
return e.Message
2020-01-13 21:05:38 +13:00
}