From de65f7ec41ed0bfc31e0cc7a87bb04a70dc72a07 Mon Sep 17 00:00:00 2001 From: Silvan Jegen Date: Wed, 15 Feb 2017 12:35:20 +0100 Subject: Propagate Input error --- input/http/http.go | 3 +-- input/stdin/stdin.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'input') diff --git a/input/http/http.go b/input/http/http.go index 71a0340..fcac066 100644 --- a/input/http/http.go +++ b/input/http/http.go @@ -42,9 +42,8 @@ func (hi *HTTPInput) httphandler(w http.ResponseWriter, r *http.Request) { all, err := ioutil.ReadAll(r.Body) if err != nil { fmt.Printf("Error when reading HTTP request body: %q\n", err) - return } - hi.retchan <- &work.Work{Data: all} + hi.retchan <- &work.Work{Data: all, Err: err} } func (hi *HTTPInput) Start() chan *work.Work { diff --git a/input/stdin/stdin.go b/input/stdin/stdin.go index e2910ec..394b952 100644 --- a/input/stdin/stdin.go +++ b/input/stdin/stdin.go @@ -35,9 +35,8 @@ func (i *StdinInput) Start() chan *work.Work { } if err != nil { fmt.Printf("Error when reading input from Stdin: %q", err) - os.Exit(1) } - i.retchan <- &work.Work{Data: bs} + i.retchan <- &work.Work{Data: bs, Err: err} } close(i.retchan) }() -- cgit v1.2.1-18-gbd029