Implement utility function for formatting and printing errors

This commit is contained in:
2025-02-01 20:48:03 -05:00
parent 173574eb85
commit e9d0c37043
18 changed files with 84 additions and 159 deletions
+1 -3
View File
@@ -3,7 +3,6 @@
package core
import (
"fmt"
"os"
"os/exec"
"strconv"
@@ -17,8 +16,7 @@ func LaunchClipClearProcess(copySubject string, isWayland bool) {
WriteToStdin(cmd, copySubject)
err := cmd.Start()
if err != nil {
fmt.Println(AnsiError + "Failed to launch automated clipboard clearing process - Does this libmutton implementation support the \"clipclear\" argument?" + AnsiReset)
os.Exit(ErrorClipboard)
PrintError("Failed to launch automated clipboard clearing process - Does this libmutton implementation support the \"clipclear\" argument?", ErrorClipboard, true)
}
os.Exit(0) // use os.Exit directly since this version of this function is only meant for non-interactive CLI implementations
}