Skip to content

Commit

Permalink
Make all fields of *gqlerror.Error public (#273)
Browse files Browse the repository at this point in the history
* make *gqlerror.Error err public

* Update error.go
  • Loading branch information
fredzqm committed Sep 7, 2023
1 parent a7d0f67 commit c0a44fb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gqlerror/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

// Error is the standard graphql error type described in https://spec.graphql.org/draft/#sec-Errors
type Error struct {
err error `json:"-"`
Err error `json:"-"`
Message string `json:"message"`
Path ast.Path `json:"path,omitempty"`
Locations []Location `json:"locations,omitempty"`
Expand Down Expand Up @@ -69,7 +69,7 @@ func (err *Error) pathString() string {
}

func (err *Error) Unwrap() error {
return err.err
return err.Err
}

func (err *Error) AsError() error {
Expand Down Expand Up @@ -111,7 +111,7 @@ func WrapPath(path ast.Path, err error) *Error {
return nil
}
return &Error{
err: err,
Err: err,
Message: err.Error(),
Path: path,
}
Expand All @@ -122,7 +122,7 @@ func Wrap(err error) *Error {
return nil
}
return &Error{
err: err,
Err: err,
Message: err.Error(),
}
}
Expand All @@ -135,7 +135,7 @@ func WrapIfUnwrapped(err error) *Error {
return gqlErr
}
return &Error{
err: err,
Err: err,
Message: err.Error(),
}
}
Expand Down

0 comments on commit c0a44fb

Please sign in to comment.