diff options
author | Tulir Asokan <tulir@maunium.net> | 2018-03-19 01:18:36 +0200 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2018-03-19 01:21:53 +0200 |
commit | 7a4b108b37ccf415f75d74738dddbdba23af1805 (patch) | |
tree | c24add86e6e6f489ef9e05bf9a5463463613fa12 /ui/view-main.go | |
parent | f288a18a0c0ea2609667a02ebe42ca0a8b034004 (diff) |
Avoid showing panics directly if debug mode is not enabled
Diffstat (limited to 'ui/view-main.go')
-rw-r--r-- | ui/view-main.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/view-main.go b/ui/view-main.go index 8ec482e..c2cd30f 100644 --- a/ui/view-main.go +++ b/ui/view-main.go @@ -148,7 +148,7 @@ func (view *MainView) InputDone(key tcell.Key) { } func (view *MainView) HandleCommand(room, command string, args []string) { - view.gmx.Recover() + defer view.gmx.Recover() debug.Print("Handling command", command, args) switch command { case "/quit": @@ -156,6 +156,8 @@ func (view *MainView) HandleCommand(room, command string, args []string) { case "/clearcache": view.config.Session.Clear() view.gmx.Stop() + case "/panic": + panic("This is a test panic.") case "/part": fallthrough case "/leave": |