Skip to content

Commit bb6a3ee

Browse files
committed
fix(go): Do not prefix exit code onto error messages
`exit.Wrap` allows you to annotate an exit disposition to an error anywhere in the stack, but `exit 80:` just clutters up the error message in `exit 80: underlying error` — and is maybe even odder when the error is wrapped farther up the stack as in `wrapped: exit 80: underlying error`
1 parent e508bcb commit bb6a3ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

exit.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ type Error struct {
134134

135135
func (e Error) Error() string {
136136
if e.Cause != nil {
137-
return fmt.Sprintf("exit %d: %s", e.Code, e.Cause)
137+
return e.Cause.Error()
138138
} else {
139139
return fmt.Sprintf("exit %d", e.Code)
140140
}

0 commit comments

Comments
 (0)