Skip to content

Commit

Permalink
fix(cli): show correct paths in orion error stack traces (#7034)
Browse files Browse the repository at this point in the history
### Changes are visible to end-users: no

### Test plan

- Covered by existing test cases

GitOrigin-RevId: 8f231d868477f4970ec9261edac355f3c157b0b5
  • Loading branch information
jbedard committed Oct 24, 2024
1 parent 92eed05 commit dea21a9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gazelle/common/starlark/utils/err.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ func evalCallbackString(stack starlark.CallStack) string {
fmt.Fprintf(out, "Traceback (most recent call last):\n")
}
for _, fr := range stack {
fmt.Fprintf(out, " %s: in %s\n", strings.TrimLeft(fr.Pos.String(), strip), fr.Name)
p := strings.TrimPrefix(fr.Pos.String(), strip)
p = strings.Trim(p, " \n\r\t/\\")
fmt.Fprintf(out, " %s: in %s\n", p, fr.Name)
}
return out.String()
}
Expand Down

0 comments on commit dea21a9

Please sign in to comment.