aboutsummaryrefslogtreecommitdiff
path: root/gomuks.go
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2018-03-15 18:21:14 +0200
committerTulir Asokan <tulir@maunium.net>2018-03-15 18:21:14 +0200
commit4db41167976e111c0c2991b408752ef3caeb28d4 (patch)
treec63effb034ccc448e5309def3b7a405855e1a184 /gomuks.go
parentdeb2c1ac16ffc79636b1269ebaa05f08ea4a8213 (diff)
Here have code
Diffstat (limited to 'gomuks.go')
-rw-r--r--gomuks.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/gomuks.go b/gomuks.go
index e87da59..13b6672 100644
--- a/gomuks.go
+++ b/gomuks.go
@@ -34,6 +34,7 @@ type Gomuks interface {
Start()
Stop()
+ Recover()
}
type gomuks struct {
@@ -79,6 +80,15 @@ func (gmx *gomuks) Stop() {
}
}
+func (gmx *gomuks) Recover() {
+ if p := recover(); p != nil {
+ if gmx.App().GetScreen() != nil {
+ gmx.App().GetScreen().Fini()
+ }
+ panic(p)
+ }
+}
+
func (gmx *gomuks) Start() {
if err := gmx.app.Run(); err != nil {
panic(err)