@@ 4,6 4,7 @@ import (
"context"
"fmt"
"net/http"
+ "strings"
"time"
"git.sr.ht/~emersion/gqlclient"
@@ 80,9 81,19 @@ func Execute(ctx context.Context, op *gqlclient.Operation, result interface{}) e
client = gqlclient.New(origin, httpClient)
err := client.Execute(ctx, op, &result)
- if graphErrors, ok := err.(interface{ Unwrap() []error }); ok {
- errs := graphErrors.Unwrap()
- err = errs[0]
+ if err != nil {
+ if graphErrors, ok := err.(interface{ Unwrap() []error }); ok {
+ errs := graphErrors.Unwrap()
+ err = errs[0]
+ } else {
+ estr := err.Error()
+ if strings.HasPrefix(estr, "HTTP request failed:") &&
+ strings.HasSuffix(estr, "context canceled") {
+ // Stupid f'n bots. Return this because gobwebs will not send an error email
+ // for this error
+ return context.Canceled
+ }
+ }
}
return err
}