Skip to content

Commit

Permalink
Tidy up error message to be less repetative
Browse files Browse the repository at this point in the history
  • Loading branch information
illicitonion committed Feb 10, 2023
1 parent 8241316 commit c8c2e77
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/gazelle/fix-update.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ func runFixUpdate(wd string, cmd command, args []string) (err error) {
for _, r := range allRules {
repl, err := lookupMapKindReplacement(c.KindMap, r.Kind())
if err != nil {
errorsFromWalk = append(errorsFromWalk, fmt.Errorf("couldn't handle loop in map_kinds: %w", err))
errorsFromWalk = append(errorsFromWalk, fmt.Errorf("looking up mapped kind: %w", err))
continue
}
if repl != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/gazelle/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3468,7 +3468,7 @@ func TestMapKindLoop(t *testing.T) {
t.Fatal("Expected error running gazelle with map_kind loop")
}
msg := err.Error()
if !strings.Contains(msg, "couldn't handle loop in map_kinds: found loop of map_kind replacements: go_library -> custom_go_library -> go_library") {
if !strings.Contains(msg, "looking up mapped kind: found loop of map_kind replacements: go_library -> custom_go_library -> go_library") {
t.Fatalf("Expected error to contain useful descriptors but was %q", msg)
}
}
Expand Down

0 comments on commit c8c2e77

Please sign in to comment.