File tree 4 files changed +10
-5
lines changed 4 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,13 @@ package graphql
2
2
3
3
import (
4
4
"context"
5
- "errors"
6
5
"fmt"
7
6
"reflect"
8
7
"strings"
9
8
10
9
"github.com/graphql-go/graphql/gqlerrors"
11
10
"github.com/graphql-go/graphql/language/ast"
11
+ "github.com/pkg/errors"
12
12
)
13
13
14
14
type ExecuteParams struct {
Original file line number Diff line number Diff line change 1
1
package gqlerrors
2
2
3
3
import (
4
- "errors"
5
-
6
4
"github.com/graphql-go/graphql/language/location"
5
+ "github.com/pkg/errors"
7
6
)
8
7
9
8
type FormattedError struct {
10
9
Message string `json:"message"`
11
10
Locations []location.SourceLocation `json:"locations"`
11
+ cause error
12
12
}
13
13
14
14
func (g FormattedError ) Error () string {
15
15
return g .Message
16
16
}
17
17
18
+ func (g FormattedError ) Cause () error {
19
+ return g .cause
20
+ }
21
+
18
22
func NewFormattedError (message string ) FormattedError {
19
23
err := errors .New (message )
20
24
return FormatError (err )
@@ -38,6 +42,7 @@ func FormatError(err error) FormattedError {
38
42
return FormattedError {
39
43
Message : err .Error (),
40
44
Locations : []location.SourceLocation {},
45
+ cause : err ,
41
46
}
42
47
}
43
48
}
Original file line number Diff line number Diff line change 1
1
package gqlerrors
2
2
3
3
import (
4
- "errors"
5
4
"github.com/graphql-go/graphql/language/ast"
5
+ "github.com/pkg/errors"
6
6
)
7
7
8
8
// NewLocatedError creates a graphql.Error with location info
Original file line number Diff line number Diff line change 1
1
package graphql
2
2
3
3
import (
4
- "errors"
5
4
"github.com/graphql-go/graphql/gqlerrors"
6
5
"github.com/graphql-go/graphql/language/ast"
6
+ "github.com/pkg/errors"
7
7
)
8
8
9
9
func NewLocatedError (err interface {}, nodes []ast.Node ) * gqlerrors.Error {
You can’t perform that action at this time.
0 commit comments