diff options
author | Tulir Asokan <tulir@maunium.net> | 2018-03-15 18:21:14 +0200 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2018-03-15 18:21:14 +0200 |
commit | 4db41167976e111c0c2991b408752ef3caeb28d4 (patch) | |
tree | c63effb034ccc448e5309def3b7a405855e1a184 /gomuks.go | |
parent | deb2c1ac16ffc79636b1269ebaa05f08ea4a8213 (diff) |
Here have code
Diffstat (limited to 'gomuks.go')
-rw-r--r-- | gomuks.go | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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) |