>
>
> r, _ = Filter(r, query)
> w = LastErrorWrapper(w)
> _, err = io.Copy(w, r)
> if err != nil and w.LastError != nil { # error writing to output,
> abort.
>
I got halfway through implementing a "LastErrorWrapper" and realized it
looked familiar.. that's because it's described
On Wednesday, February 7, 2018 at 8:54:12 AM UTC-5, Jakob Borg wrote:
>
> On 7 Feb 2018, at 14:45, Justin Azoff >
> wrote:
>
>
> Is there some way to inspect that error to figure out that it was related
> to reading from 'gr' and not writing to /dev/null?
>
>
> Two options that come to mind are
>
On 7 Feb 2018, at 14:45, Justin Azoff
mailto:justin.az...@gmail.com>> wrote:
Is there some way to inspect that error to figure out that it was related to
reading from 'gr' and not writing to /dev/null?
Two options that come to mind are
- handling the copy yourself so you get separate Read() a
backend.FilterIPs should return differentiable error - whether this is a
transient or a permanent error.
I'd use github.com/pkg/errors:
var ErrTransient = errors.New("transient error")
...
func FilterIPs(...) error {
if err != nil && err.IsTemporary() {
return errors.Wrap(ErrTransient, er
Hi!
I have a simple service that has an API for searching things like log
files. One of the API endpoints returns just the matching documents, while
another will try to return the matching records from those documents.
Because this output could be quite large (and so that results stream) I
pa