summaryrefslogtreecommitdiff
path: root/util.go
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-05-23 11:27:56 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-05-23 11:27:56 -0400
commit602ee0d5a1b092faf8f29cac0727a28640aac0b0 (patch)
treed050b0f2d12ec989d40305bf43d79a0633905b74 /util.go
parent08b327bf3afd7ad180fe807c4292c23cc6942b56 (diff)
Better exception output
Diffstat (limited to 'util.go')
-rw-r--r--util.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/util.go b/util.go
index 3e0ac6374..9fab27238 100644
--- a/util.go
+++ b/util.go
@@ -2,6 +2,7 @@ package main
import (
"net/url"
+ "os"
)
func assert(cond bool, msg string) {
@@ -21,3 +22,10 @@ func check(e error) {
panic(e)
}
}
+
+func exitOnError(err error) {
+ if err != nil {
+ os.Stderr.WriteString(err.Error())
+ os.Exit(1)
+ }
+}