summaryrefslogtreecommitdiff
path: root/init.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-02-15 16:27:07 -0500
committerPietro Gagliardi <[email protected]>2014-02-15 16:27:07 -0500
commit16e561c1e37e08131bc8f9705b97f4b5c38ce226 (patch)
treed023820584f70cdc6df2952df8b0cc71c9f9d548 /init.go
parent0e41eddf54740cb2de1ff426ffd294d3301a0d1c (diff)
Added message boxes and adjusted init() accordingly to display one on failure.
Diffstat (limited to 'init.go')
-rw-r--r--init.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/init.go b/init.go
index 799add6..c3c0aea 100644
--- a/init.go
+++ b/init.go
@@ -2,16 +2,20 @@
//package ui
package main
-// TODO this will be system-defined
-func initpanic(err error) {
- panic("failure during init: " + err.Error())
-}
+import (
+ "os"
+)
func init() {
initDone := make(chan error)
go ui(initDone)
err := <-initDone
if err != nil {
- initpanic(err)
+ // TODO provide copying instructions? will need to be system-specific
+ MsgBoxError("UI Library Init Failure",
+ "A failure occured during UI library initialization:\n%v\n" +
+ "Please report this to the application developer or on http://github.com/andlabs/ui.",
+ err)
+ os.Exit(1)
}
}