From bdccc51437badbf0a680825948cba24ec4c7567f Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Sun, 20 Sep 2015 10:55:16 -0600 Subject: [PATCH] More consistent error messages --- middleware/errors/errors.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/middleware/errors/errors.go b/middleware/errors/errors.go index 44451ab1..22209e91 100644 --- a/middleware/errors/errors.go +++ b/middleware/errors/errors.go @@ -53,7 +53,8 @@ func (h ErrorHandler) errorPage(w http.ResponseWriter, code int) { errorPage, err := os.Open(pagePath) if err != nil { // An error handling an error... - 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) return } @@ -66,7 +67,8 @@ func (h ErrorHandler) errorPage(w http.ResponseWriter, code int) { if err != nil { // 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) }