HTTPErrorf creates an HTTPError with an http status code and a formatted message.
(status int, format string, args ...interface{})
| 104 | |
| 105 | // HTTPErrorf creates an HTTPError with an http status code and a formatted message. |
| 106 | func HTTPErrorf(status int, format string, args ...interface{}) *HTTPError { |
| 107 | return NewHTTPError(status, fmt.Errorf(format, args...).Error()) |
| 108 | } |
| 109 | |
| 110 | // NewHTTPError creates an HTTPError with an http status code and a message. Use HTTPErrorf for printf style messages. |
| 111 | func NewHTTPError(status int, message string) *HTTPError { |