Add better error handling for a failed login attempt