Merge pull request #1857 from deads2k/dev/deads/fixup-error-reporting

report originating error for GetReference failure
pull/6/head
Daniel Smith 2014-10-17 10:44:34 -07:00
commit 34a64a270d
2 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ func RecoverPanics(handler http.Handler) http.Handler {
if x := recover(); x != nil {
w.WriteHeader(http.StatusInternalServerError)
fmt.Fprint(w, "apis panic. Look in log for details.")
glog.Infof("APIServer panic'd on %v %v: %#v\n%s\n", req.Method, req.RequestURI, x, debug.Stack())
glog.Infof("APIServer panic'd on %v %v: %v\n%s\n", req.Method, req.RequestURI, x, debug.Stack())
}
}()
defer httplog.NewLogged(req, &w).StacktraceWhen(

View File

@ -99,7 +99,7 @@ var events = watch.NewMux(queueLen)
func Event(object runtime.Object, fieldPath, status, reason, message string) {
ref, err := api.GetReference(object)
if err != nil {
glog.Errorf("Could not construct reference to: %#v", object)
glog.Errorf("Could not construct reference to: %#v due to: %v", object, err)
return
}
ref.FieldPath = fieldPath