зеркало из https://github.com/golang/build.git
devapp: log error if encoding owners response fails
Includes changes mistakenly omitted from 110996 Change-Id: I3e3da2590120f810d0413606c77cc0afa76029a9 Reviewed-on: https://go-review.googlesource.com/111115 Reviewed-by: Andrew Bonventre <andybons@golang.org>
This commit is contained in:
Родитель
728cad7784
Коммит
8c46052de7
|
@ -7,6 +7,7 @@ package owners
|
|||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"log"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
@ -57,6 +58,8 @@ func Handler(w http.ResponseWriter, r *http.Request) {
|
|||
var buf bytes.Buffer
|
||||
if err := json.NewEncoder(&buf).Encode(e); err != nil {
|
||||
http.Error(w, "unable to encode response", http.StatusInternalServerError)
|
||||
// TODO: increment expvar for monitoring.
|
||||
log.Printf("unable to encode owners response: %v", err)
|
||||
return
|
||||
}
|
||||
w.Write(buf.Bytes())
|
||||
|
|
Загрузка…
Ссылка в новой задаче