Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make all fields of *gqlerror.Error public #273

Merged
merged 3 commits into from
Sep 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading