aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/99designs/gqlgen/graphql/error.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/99designs/gqlgen/graphql/error.go')
-rw-r--r--vendor/github.com/99designs/gqlgen/graphql/error.go33
1 files changed, 0 insertions, 33 deletions
diff --git a/vendor/github.com/99designs/gqlgen/graphql/error.go b/vendor/github.com/99designs/gqlgen/graphql/error.go
deleted file mode 100644
index af8b4ce4..00000000
--- a/vendor/github.com/99designs/gqlgen/graphql/error.go
+++ /dev/null
@@ -1,33 +0,0 @@
-package graphql
-
-import (
- "context"
-
- "github.com/vektah/gqlparser/gqlerror"
-)
-
-type ErrorPresenterFunc func(context.Context, error) *gqlerror.Error
-
-type ExtendedError interface {
- Extensions() map[string]interface{}
-}
-
-func DefaultErrorPresenter(ctx context.Context, err error) *gqlerror.Error {
- if gqlerr, ok := err.(*gqlerror.Error); ok {
- if gqlerr.Path == nil {
- gqlerr.Path = GetResolverContext(ctx).Path()
- }
- return gqlerr
- }
-
- var extensions map[string]interface{}
- if ee, ok := err.(ExtendedError); ok {
- extensions = ee.Extensions()
- }
-
- return &gqlerror.Error{
- Message: err.Error(),
- Path: GetResolverContext(ctx).Path(),
- Extensions: extensions,
- }
-}