lint
This commit is contained in:
parent
8ab7522c55
commit
ba9e9ab9ab
1 changed files with 6 additions and 2 deletions
8
main.go
8
main.go
|
@ -71,14 +71,18 @@ func errorHandler(w http.ResponseWriter, r *http.Request) {
|
|||
generateInternalServerError(w, err)
|
||||
return
|
||||
}
|
||||
t.Execute(w, errorData)
|
||||
if err := t.Execute(w, errorData); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func generateInternalServerError(w http.ResponseWriter, err error) {
|
||||
log.Println(err)
|
||||
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
w.Write([]byte(`{"error": "Internal Server Error"}`))
|
||||
if _, err := w.Write([]byte(`{"error": "Internal Server Error"}`)); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func headersHandler(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
Loading…
Reference in a new issue