Skip to content

Commit

Permalink
return on invalid status for debug
Browse files Browse the repository at this point in the history
  • Loading branch information
vbauerster committed Feb 7, 2025
1 parent a0d10b0 commit 3ef1a1d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion getparty.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ func (cmd Cmd) Exit(err error) (status int) {
}

defer func() {
if status != 2 && status != 4 && cmd.opt.Debug {
switch status {
case 0, 2, 4:
return
}
if cmd.opt.Debug {
cmd.loggers[DEBUG].Printf("ERROR: %s", err.Error())
if e := (*stack)(nil); errors.As(err, &e) {
_, err := cmd.Err.Write(e.stack)
Expand Down

0 comments on commit 3ef1a1d

Please sign in to comment.