(w rest.ResponseWriter, error string, error_code int, http_code int)
| 52 | var languages = SupportedLanguages{} |
| 53 | |
| 54 | func (a *API) Error(w rest.ResponseWriter, error string, error_code int, http_code int) { |
| 55 | w.WriteHeader(http_code) |
| 56 | err := w.WriteJson(map[string]string{"Error": error, "ErrorCode": strconv.Itoa(error_code)}) |
| 57 | if err != nil { |
| 58 | panic(err) |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | // StartAPI starts the API listeners |
| 63 | func (a *API) StartAPI() error { |
no outgoing calls
no test coverage detected