Exception: Parse::Error::EmailNotVerifiedError

Inherits:
AuthenticationError show all
Defined in:
lib/parse/model/classes/user.rb

Overview

Error code 205 (Parse::Response::ERROR_EMAIL_NOT_FOUND) raised by User.login! and User#verify_password when Parse Server returns code 205 because +preventLoginWithUnverifiedEmail+ is enabled and the account's email address has not been verified.

It is a SUBCLASS of AuthenticationError on purpose: before this typed error existed, the unverified-email rejection raised a plain +AuthenticationError+, so existing callers wrapping User.login! in +rescue AuthenticationError+ must keep catching it (subclassing keeps that contract — making it a sibling would be a silent breaking change). Callers who want to special-case the unverified-email path just rescue this narrower subclass FIRST.

Examples:

begin
  Parse::User.login!(username, password)
rescue Parse::Error::EmailNotVerifiedError
  # Prompt user to check their inbox and verify their email
rescue Parse::Error::AuthenticationError
  # Wrong credentials or other login failure (still catches the above
  # too, if no narrower rescue precedes it)
end

Instance Attribute Summary

Attributes inherited from Parse::Error

#code

Method Summary

Methods inherited from Parse::Error

#initialize

Constructor Details

This class inherits a constructor from Parse::Error