Handle error template errors (#332)
This commit is contained in:
parent
82412aced6
commit
87505f1a42
1 changed files with 5 additions and 2 deletions
|
@ -407,12 +407,15 @@ func renderHTTPError(log logrus.FieldLogger, r *http.Request, w http.ResponseWri
|
||||||
errMsg := fmt.Sprintf("%+v", err)
|
errMsg := fmt.Sprintf("%+v", err)
|
||||||
|
|
||||||
w.WriteHeader(code)
|
w.WriteHeader(code)
|
||||||
templates.ExecuteTemplate(w, "error", map[string]interface{}{
|
if templateErr := templates.ExecuteTemplate(w, "error", map[string]interface{}{
|
||||||
"session_id": sessionID(r),
|
"session_id": sessionID(r),
|
||||||
"request_id": r.Context().Value(ctxKeyRequestID{}),
|
"request_id": r.Context().Value(ctxKeyRequestID{}),
|
||||||
"error": errMsg,
|
"error": errMsg,
|
||||||
"status_code": code,
|
"status_code": code,
|
||||||
"status": http.StatusText(code)})
|
"status": http.StatusText(code),
|
||||||
|
}); templateErr != nil {
|
||||||
|
log.Println(templateErr)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func currentCurrency(r *http.Request) string {
|
func currentCurrency(r *http.Request) string {
|
||||||
|
|
Loading…
Reference in a new issue