summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--input/http/http.go3
-rw-r--r--input/stdin/stdin.go3
-rw-r--r--manager.go4
3 files changed, 6 insertions, 4 deletions
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)
}()
diff --git a/manager.go b/manager.go
index 0eeb51f..d3d38fd 100644
--- a/manager.go
+++ b/manager.go
@@ -21,6 +21,10 @@ func (m *Manager) Run() {
ic := m.Input.Start()
for w := range ic {
+ if w.Err != nil {
+ fmt.Printf("Got an error when getting Work input: %q\n", w.Err)
+ continue
+ }
wg.Add(1)
go func(w *work.Work) {