Commit b93eaec5 authored by Aksel Baardsen's avatar Aksel Baardsen
Browse files

Fixed http.error messages

parent d5370b5b
......@@ -71,13 +71,13 @@ func HttpError(w http.ResponseWriter, err error) {
// if timeout happened
if errT, ok := err.(net.Error); ok && errT.Timeout() {
http.Error(w, "Request to API timed out", http.StatusGatewayTimeout)
http.Error(w, "Gateway Timeout", http.StatusGatewayTimeout)
return // return if error is already displayed
}
// if a custom error was sent (caused by api response code)
if strings.Contains(err.Error(), "bad status code:") {
http.Error(w, "Request to API timed out", http.StatusGatewayTimeout)
http.Error(w, "Bad Gateway", http.StatusBadGateway)
return // return if error is already displayed
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment