Chromium Code Reviews| 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 |
| + } |
| } |