Always hard exit in PrintError(); do not pointlessly return the error code in soft exit

This commit is contained in:
2025-06-01 16:58:29 -04:00
parent 71b5056ca6
commit 83b0be1379
2 changed files with 5 additions and 10 deletions
+3 -8
View File
@@ -9,13 +9,8 @@ import (
// PrintError prints an error message in the MUTN format and exits with the specified exit code.
// Requires: message (the error message to print),
// exitCode (the exit code to use),
// forceHardExit (if true, exit immediately; if false, allow soft exit for interactive clients).
func PrintError(message string, exitCode int, forceHardExit bool) {
// exitCode (the exit code to use)
func PrintError(message string, exitCode int) {
fmt.Println(back.AnsiError + message + back.AnsiReset)
if forceHardExit {
os.Exit(exitCode)
} else {
back.Exit(exitCode)
}
os.Exit(exitCode)
}