mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
always log the panic trace
This commit is contained in:
parent
7b58bf76ef
commit
6130e48a67
@ -185,10 +185,13 @@ func (client *Client) run() {
|
||||
var msg ircmsg.IrcMessage
|
||||
|
||||
defer func() {
|
||||
if client.server.RecoverFromErrors() {
|
||||
if r := recover(); r != nil {
|
||||
client.server.logger.Error("internal",
|
||||
fmt.Sprintf("Client caused panic, disconnecting: %v\n%s", r, debug.Stack()))
|
||||
if r := recover(); r != nil {
|
||||
client.server.logger.Error("internal",
|
||||
fmt.Sprintf("Client caused panic: %v\n%s", r, debug.Stack()))
|
||||
if client.server.RecoverFromErrors() {
|
||||
client.server.logger.Error("internal", "Disconnecting client and attempting to recover")
|
||||
} else {
|
||||
panic(r)
|
||||
}
|
||||
}
|
||||
// ensure client connection gets closed
|
||||
|
Loading…
Reference in New Issue
Block a user