log panic traces via the usual logging mechanism

This commit is contained in:
Shivaram Lingamneni 2017-10-25 13:19:08 -04:00
parent 054f57e215
commit 80968d000f
1 changed files with 2 additions and 2 deletions

View File

@ -186,8 +186,8 @@ func (client *Client) run() {
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
client.server.logger.Error("internal", fmt.Sprintf("Client caused panic, disconnecting: %v", r)) client.server.logger.Error("internal",
debug.PrintStack() fmt.Sprintf("Client caused panic, disconnecting: %v\n%s", r, debug.Stack()))
} }
// ensure client connection gets closed // ensure client connection gets closed
client.destroy() client.destroy()