Enter key action, and more tries and catches

Login button is clicked when Enter key is pressed. Tried to make safer code using try and catch, so that crashes are reduced. Shows message when server is down, or if host is not connected to the net.