The login method now throws specific exceptions if something goes wrong during the login process. This is the ideal way for a developer using this API to handle errors.