Commit bdccc514 authored by Matthew Holt's avatar Matthew Holt

More consistent error messages

parent 10ab0378
...@@ -53,7 +53,8 @@ func (h ErrorHandler) errorPage(w http.ResponseWriter, code int) { ...@@ -53,7 +53,8 @@ func (h ErrorHandler) errorPage(w http.ResponseWriter, code int) {
errorPage, err := os.Open(pagePath) errorPage, err := os.Open(pagePath)
if err != nil { if err != nil {
// An error handling an error... <insert grumpy cat here> // An error handling an error... <insert grumpy cat here>
h.Log.Printf("HTTP %d could not load error page %s: %v", code, pagePath, err) h.Log.Printf("%s [HTTP %d] could not load error page %s: %v",
time.Now().Format(timeFormat), code, pagePath, err)
http.Error(w, defaultBody, code) http.Error(w, defaultBody, code)
return return
} }
...@@ -66,7 +67,8 @@ func (h ErrorHandler) errorPage(w http.ResponseWriter, code int) { ...@@ -66,7 +67,8 @@ func (h ErrorHandler) errorPage(w http.ResponseWriter, code int) {
if err != nil { if err != nil {
// Epic fail... sigh. // Epic fail... sigh.
h.Log.Printf("HTTP %d could not respond with %s: %v", code, pagePath, err) h.Log.Printf("%s [HTTP %d] could not respond with %s: %v",
time.Now().Format(timeFormat), code, pagePath, err)
http.Error(w, defaultBody, code) http.Error(w, defaultBody, code)
} }
......
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