summaryrefslogtreecommitdiff
path: root/http
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-03 22:15:56 +0300
committerWolfy-J <[email protected]>2018-06-03 22:15:56 +0300
commit1856b93ac024988322dec1760286de75158ae02d (patch)
treef1a96ace8ed69ad86de270de68d312c81702749f /http
parented2719f7d4fc4ccde61e3a5c104a49b7e9e9ea5f (diff)
error handling
Diffstat (limited to 'http')
-rw-r--r--http/server.go5
-rw-r--r--http/service.go7
2 files changed, 2 insertions, 10 deletions
diff --git a/http/server.go b/http/server.go
index 22c6380a..db1f22ef 100644
--- a/http/server.go
+++ b/http/server.go
@@ -81,10 +81,7 @@ func (srv *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// sendError sends error
func (srv *Server) sendError(w http.ResponseWriter, r *http.Request, err error) {
- if _, job := err.(roadrunner.JobError); !job {
- logrus.Error(err)
- }
-
+ logrus.Errorf("http: %s", err)
w.WriteHeader(500)
w.Write([]byte(err.Error()))
}
diff --git a/http/service.go b/http/service.go
index f8e05f4d..5d45240b 100644
--- a/http/service.go
+++ b/http/service.go
@@ -50,18 +50,13 @@ func (s *Service) Serve() error {
}
defer term()
+ //todo: remove
rr.Observe(func(event int, ctx interface{}) {
switch event {
case roadrunner.EventPoolError:
logrus.Error(ctx)
- case roadrunner.EventWorkerCreate:
- logrus.Infof("%s - created", ctx)
case roadrunner.EventWorkerError:
logrus.Errorf("%s: %s", ctx.(roadrunner.WorkerError).Worker, ctx.(roadrunner.WorkerError).Error())
- case roadrunner.EventWorkerDestruct:
- logrus.Warnf("%s - destructed", ctx)
- case roadrunner.EventWorkerKill:
- logrus.Warnf("%s - killed", ctx)
}
})