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

Unified Diff: go/src/infra/tricium/service/workflow-launcher/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
Index: go/src/infra/tricium/service/workflow-launcher/handlers.go
diff --git a/go/src/infra/tricium/service/workflow-launcher/handlers.go b/go/src/infra/tricium/service/workflow-launcher/handlers.go
index 6be1d5f5c04b30e02cba033c74a1f71be06050fe..07fcbe92d8b1462ee40e4bcf2959f854db3422ec 100644
--- a/go/src/infra/tricium/service/workflow-launcher/handlers.go
+++ b/go/src/infra/tricium/service/workflow-launcher/handlers.go
@@ -25,7 +25,10 @@ func statusPageHandler(w http.ResponseWriter, r *http.Request) {
data := map[string]interface{}{
"Msg": "Status of the Workflow Launcher ...",
}
- basePage.Execute(w, data)
+ if e := basePage.Execute(w, data); e != nil {
+ http.Error(w, e.Error(), http.StatusInternalServerError)
+ return
+ }
}
func queueHandler(w http.ResponseWriter, r *http.Request) {
@@ -35,8 +38,8 @@ func queueHandler(w http.ResponseWriter, r *http.Request) {
// Enqueue workflow listener task
t := taskqueue.NewPOSTTask("/workflow-listener/queue-handler", map[string][]string{"name": {"Workflow Launched"}})
- if _, err := taskqueue.Add(ctx, t, "workflow-listener-queue"); err != nil {
- http.Error(w, err.Error(), http.StatusInternalServerError)
+ if _, e := taskqueue.Add(ctx, t, "workflow-listener-queue"); e != nil {
+ http.Error(w, e.Error(), http.StatusInternalServerError)
return
}
}

Powered by Google App Engine
This is Rietveld 408576698