Error returns an error that can be used to write an HTTP response with an error message and a specific status code.
(err error, code int)
| 22 | // Error returns an error that can be used to write an |
| 23 | // HTTP response with an error message and a specific status code. |
| 24 | func Error(err error, code int) error { |
| 25 | return &HTTPError{ |
| 26 | code: code, |
| 27 | err: err, |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | // ErrorStr is like Error but takes a string message instead of an error. |
| 32 | func ErrorStr(err string, code int) error { |
no outgoing calls