summaryrefslogtreecommitdiff
path: root/service/http/handler.go
diff options
context:
space:
mode:
Diffstat (limited to 'service/http/handler.go')
-rw-r--r--service/http/handler.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/service/http/handler.go b/service/http/handler.go
index 2d749207..0124a2a4 100644
--- a/service/http/handler.go
+++ b/service/http/handler.go
@@ -97,11 +97,6 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
resp.Write(w)
}
-// handleResponse triggers response event.
-func (h *Handler) handleResponse(req *Request, resp *Response) {
- h.throw(EventResponse, &Event{Method: req.Method, Uri: req.Uri, Status: resp.Status})
-}
-
// handleError sends error.
func (h *Handler) handleError(w http.ResponseWriter, r *http.Request, err error) {
h.throw(EventError, &Event{Method: r.Method, Uri: uri(r), Status: 500, Error: err})
@@ -110,6 +105,11 @@ func (h *Handler) handleError(w http.ResponseWriter, r *http.Request, err error)
w.Write([]byte(err.Error()))
}
+// handleResponse triggers response event.
+func (h *Handler) handleResponse(req *Request, resp *Response) {
+ h.throw(EventResponse, &Event{Method: req.Method, Uri: req.Uri, Status: resp.Status})
+}
+
// throw invokes event srv if any.
func (h *Handler) throw(event int, ctx interface{}) {
h.mul.Lock()