Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2390)

Unified Diff: go/src/infra/tricium/service/default/handlers.go

Issue 2149853003: Adds checking of template error (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | go/src/infra/tricium/service/gerrit-poller/handlers.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/src/infra/tricium/service/default/handlers.go
diff --git a/go/src/infra/tricium/service/default/handlers.go b/go/src/infra/tricium/service/default/handlers.go
index 8f5a67ef99971f60961e6ba26c51cf7d41f72889..1827fb1e2c67f05953bb7abc27a26dd091b49b6e 100644
--- a/go/src/infra/tricium/service/default/handlers.go
+++ b/go/src/infra/tricium/service/default/handlers.go
@@ -25,7 +25,10 @@ func landingPageHandler(w http.ResponseWriter, r *http.Request) {
"Msg": "This service is under construction ...",
"ShowRequestForm": true,
}
- basePage.Execute(w, data)
+ if e := basePage.Execute(w, data); e != nil {
nodir 2016/07/14 16:33:00 I recommend calling the variable "err" because it
emso 2016/07/15 11:04:43 Done.
+ http.Error(w, e.Error(), http.StatusInternalServerError)
nodir 2016/07/14 16:33:00 the error description is sent to the user and not
emso 2016/07/15 11:04:43 Done.
+ return
+ }
}
func analyzeHandler(w http.ResponseWriter, r *http.Request) {
@@ -38,5 +41,8 @@ func analyzeHandler(w http.ResponseWriter, r *http.Request) {
data := map[string]interface{}{
"Msg": "Dummy analysis request sent.",
}
- basePage.Execute(w, data)
+ if e := basePage.Execute(w, data); e != nil {
+ http.Error(w, e.Error(), http.StatusInternalServerError)
+ return
+ }
}
« no previous file with comments | « no previous file | go/src/infra/tricium/service/gerrit-poller/handlers.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698