Handle login failures

The code was missing notify() when server returned login failure. The returned error was also ignored resulting in a non-working connection returned to user application.