Better error handling when user name and password are wrong or not needed