Add error handling to login.call in tests