3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-10 22:19:31 +01:00

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

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()