Skip to content

Commit

Permalink
fix: return the original error (#2288)
Browse files Browse the repository at this point in the history
* fix: return the original error

close #2286

* Update error.go
  • Loading branch information
giautm authored Jul 12, 2022
1 parent fb13091 commit 3049369
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion graphql/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ func ErrorOnPath(ctx context.Context, err error) error {
if gqlErr.Path == nil {
gqlErr.Path = GetPath(ctx)
}
return gqlErr
// Return the original error to avoid losing any attached annotation
return err
}
return gqlerror.WrapPath(GetPath(ctx), err)
}

0 comments on commit 3049369

Please sign in to comment.