diff options
author | Silvan Jegen <s.jegen@gmail.com> | 2017-02-19 18:16:51 +0100 |
---|---|---|
committer | Silvan Jegen <s.jegen@gmail.com> | 2017-02-19 18:16:51 +0100 |
commit | b1b366ac99c06cedff8f0ffc808649f27fa98c42 (patch) | |
tree | c9b22b3e1616384ace12bcf2d134027739fab847 /filter/str | |
parent | f1eb4962060267458883f86bb5f4093b9b1afc47 (diff) |
Use a setter to set the Work error
Diffstat (limited to 'filter/str')
-rw-r--r-- | filter/str/string.go | 4 |
1 files changed, 2 insertions, 2 deletions
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 } |