aboutsummaryrefslogtreecommitdiffstats
path: root/c_utils.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-01-19 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-01-19 20:20:20 +0100
commit8102c5d23feb0fe4794b73022f57c8fd2d591e4e (patch)
tree5013b0645bad4095229aad28aa342fcacae6e99f /c_utils.go
parentyea (diff)
downloadhardflip-8102c5d23feb0fe4794b73022f57c8fd2d591e4e.tar.gz
hardflip-8102c5d23feb0fe4794b73022f57c8fd2d591e4e.tar.bz2
hardflip-8102c5d23feb0fe4794b73022f57c8fd2d591e4e.tar.xz
hardflip-8102c5d23feb0fe4794b73022f57c8fd2d591e4e.tar.zst
hardflip-8102c5d23feb0fe4794b73022f57c8fd2d591e4e.zip
good error msgs
Diffstat (limited to '')
-rw-r--r--c_utils.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/c_utils.go b/c_utils.go
index 4af14de..72761d8 100644
--- a/c_utils.go
+++ b/c_utils.go
@@ -95,3 +95,13 @@ func c_die(str string, err error) {
fmt.Fprintf(os.Stderr, "\n")
os.Exit(1)
}
+
+func c_error_mode(msg string, err error, ui *HardUI) {
+ ui.mode = ERROR_MODE
+ err_str := ""
+ if err != nil {
+ err_str = fmt.Sprintf("%v", err)
+ }
+ ui.err[ERROR_MSG] = msg
+ ui.err[ERROR_ERR] = err_str
+}