summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
Diffstat (limited to 'filter')
-rw-r--r--filter/http/http.go4
-rw-r--r--filter/str/string.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/filter/http/http.go b/filter/http/http.go
index e3d447b..3143718 100644
--- a/filter/http/http.go
+++ b/filter/http/http.go
@@ -26,14 +26,14 @@ func New(kv map[string]string) filter.Filter {
func (hf *HTTPFilter) Filter(w *work.Work) *work.Work {
resp, err := http.Post(hf.url, "application/json", bytes.NewReader(w.Data))
if err != nil {
- w.Err = err
+ w.SetError(err)
return w
}
defer resp.Body.Close()
filtered, err := ioutil.ReadAll(resp.Body)
if err != nil {
- w.Err = err
+ w.SetError(err)
return w
}
diff --git a/filter/str/string.go b/filter/str/string.go
index 37f49f6..f6087be 100644
--- a/filter/str/string.go
+++ b/filter/str/string.go
@@ -46,7 +46,7 @@ func (f *StringFilter) Filter(w *work.Work) *work.Work {
}
if err != nil {
fmt.Fprintf(os.Stderr, "Error when decoding JSON: %q\n", err)
- w.Err = err
+ w.SetError(err)
return w
}
@@ -64,7 +64,7 @@ func (f *StringFilter) Filter(w *work.Work) *work.Work {
bs, err := json.Marshal(jm)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when marshaling JSON: %q\n", err)
- w.Err = err
+ w.SetError(err)
} else {
w.Data = bs
}