Skip to content

Commit

Permalink
Separate errors with new line
Browse files Browse the repository at this point in the history
  • Loading branch information
samcoe committed Nov 17, 2021
1 parent 80d14c0 commit 641d414
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion graphql.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,12 @@ type errors []struct {
// Error implements error interface.
func (e errors) Error() string {
b := strings.Builder{}
for _, err := range e {
l := len(e)
for i, err := range e {
b.WriteString(fmt.Sprintf("Message: %s, Locations: %+v", err.Message, err.Locations))
if i != l-1 {
b.WriteString("\n")
}
}
return b.String()
}
Expand Down

0 comments on commit 641d414

Please sign in to comment.