diff options
author | Joe <rbo@gmx.us> | 2024-01-19 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-01-19 20:20:20 +0100 |
commit | 8102c5d23feb0fe4794b73022f57c8fd2d591e4e (patch) | |
tree | 5013b0645bad4095229aad28aa342fcacae6e99f /c_utils.go | |
parent | yea (diff) | |
download | hardflip-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.go | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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 +} |