From b1b366ac99c06cedff8f0ffc808649f27fa98c42 Mon Sep 17 00:00:00 2001 From: Silvan Jegen Date: Sun, 19 Feb 2017 18:16:51 +0100 Subject: Use a setter to set the Work error --- input/http/http.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'input/http') diff --git a/input/http/http.go b/input/http/http.go index 87ec0f9..61e2c39 100644 --- a/input/http/http.go +++ b/input/http/http.go @@ -50,10 +50,13 @@ func (hi *HTTPInput) httphandler(w http.ResponseWriter, r *http.Request) { return } all, err := ioutil.ReadAll(r.Body) + wrk := &work.Work{Data: all} if err != nil { fmt.Printf("Error when reading HTTP request body: %q\n", err) + wrk.SetError(err) } - hi.retchan <- &work.Work{Data: all, Err: err} + + hi.retchan <- wrk } func (hi *HTTPInput) Start() chan *work.Work { -- cgit v1.2.3