Refactor handler errors
This commit is contained in:
1 parent
d69df41ef0
commit
d86afb2381
3 files changed
+10
-17
No files matched your search
+1
-2
@@ -36,8 +36,7 @@ func uptimeBadgeHandler(writer http.ResponseWriter, request *http.Request) {
|
||||
case "1h":
|
||||
from = time.Now().Add(-time.Hour)
|
||||
default:
|
||||
writer.WriteHeader(http.StatusBadRequest)
|
||||
_, _ = writer.Write([]byte("Durations supported: 7d, 24h, 1h"))
|
||||
http.Error(writer, "Durations supported: 7d, 24h, 1h", http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
key := variables["key"]
|
||||
|
||||
Reference in new issue
Block a user