Catch all IOErrors and throw disconnected event