Try catch round connectionClosed event