forked from Plemya-x/ALR
refactor
This commit is contained in:
@ -17,6 +17,7 @@
|
||||
package cliutils
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
|
||||
@ -52,5 +53,8 @@ func FormatCliExit(msg string, err error) cli.ExitCoder {
|
||||
}
|
||||
|
||||
func FormatCliExitWithCode(msg string, err error, exitCode int) cli.ExitCoder {
|
||||
if err == nil {
|
||||
return cli.Exit(errors.New(msg), exitCode)
|
||||
}
|
||||
return cli.Exit(fmt.Errorf("%s: %w", msg, err), exitCode)
|
||||
}
|
||||
|
Reference in New Issue
Block a user