Skip to content

Commit

Permalink
Merge pull request #41 from google:s/improve-parse-errors
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 650089443
  • Loading branch information
copybara-github committed Jul 8, 2024
2 parents 9dba015 + b8aaf3f commit 6bb700d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion parser/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type LibraryErrors struct {
}

func (le *LibraryErrors) Error() string {
var msgs []string
msgs := []string{fmt.Sprintf("error(s) in Library %q:", le.LibKey.String())}
for _, e := range le.Errors {
msgs = append(msgs, e.Error())
}
Expand Down
3 changes: 2 additions & 1 deletion parser/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ func TestLibraryErrors(t *testing.T) {
t.Errorf("errors.Is(gotErr, ErrorBadFile) = false, want true")
}

wantErrorString := `1-1 first parsing error
wantErrorString := `error(s) in Library "TESTLIB 1.0.0":
1-1 first parsing error
2-2 second parsing error: bad file`
if gotErr.Error() != wantErrorString {
t.Errorf("gotErr.Error() = %q, want %q", gotErr.Error(), wantErrorString)
Expand Down

0 comments on commit 6bb700d

Please sign in to comment.