Check errors on template execution in test-bgp-router.
Depending on the failure mode, a failure in template execution has
a pretty good chance of producing garbled output to the browser.
Too bad, it's a test BGP router.
@@ -101,5 +101,7 @@ func status(w http.ResponseWriter, r *http.Request) {
return
}
- tmpl.Execute(w, []*values{bStat, qStat, gStat})
+ if err := tmpl.Execute(w, []*values{bStat, qStat, gStat}); err != nil {
+ http.Error(w, err.Error(), http.StatusInternalServerError)
+ }
}
