summaryrefslogtreecommitdiffhomepage
path: root/utils
diff options
context:
space:
mode:
authorspf13 <[email protected]>2013-10-09 18:52:29 -0400
committerspf13 <[email protected]>2013-10-09 18:53:46 -0400
commit0318f7c149f98eb2bcbb44b0ca1c7420379190eb (patch)
treeb5e50ef3e6853658a5af3f530f89e3276939f99b /utils
parente6ace71fecd075b96aa81b8daa3f3c368f27325f (diff)
downloadhugo-0318f7c149f98eb2bcbb44b0ca1c7420379190eb.tar.gz
hugo-0318f7c149f98eb2bcbb44b0ca1c7420379190eb.zip
Clean up server & build site logic. Fixed #94
Diffstat (limited to 'utils')
-rw-r--r--utils/utils.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/utils/utils.go b/utils/utils.go
new file mode 100644
index 000000000..641abfeb2
--- /dev/null
+++ b/utils/utils.go
@@ -0,0 +1,22 @@
+package utils
+
+import (
+ "log"
+ "os"
+)
+
+func CheckErr(err error, s ...string) {
+ if err != nil {
+ for _, message := range s {
+ log.Fatalf(message)
+ }
+ log.Fatalf("Fatal Error: %v", err)
+ }
+}
+
+func CheckErrExit(err error, s ...string) {
+ if err != nil {
+ CheckErr(err, s...)
+ os.Exit(-1)
+ }
+}