ErrorStr is like Error but takes a string message instead of an error.
(err string, code int)
| 30 | |
| 31 | // ErrorStr is like Error but takes a string message instead of an error. |
| 32 | func ErrorStr(err string, code int) error { |
| 33 | return Error(errors.New(err), code) |
| 34 | } |
| 35 | |
| 36 | // WriteErrorJSON writes an error response in JSON format to the provided |
| 37 | // http.ResponseWriter. If the error is an *httpError, it uses the code |