Files
docker-docs/errors/errors.go
Derek McGowan 6fd6773b21 Fix go vet and lint issues
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-04-10 16:52:33 -07:00

22 lines
366 B
Go

package errors
import (
"fmt"
)
// HTTPError represents an application error which will map to
// an HTTP status code and returned error object.
type HTTPError struct {
HTTPStatus int
Code int
Err error
}
func (he *HTTPError) Error() string {
msg := ""
if he.Err != nil {
msg = he.Err.Error()
}
return fmt.Sprintf("%d: %s", he.Code, msg)
}