GREYFrameworkException

@interface GREYFrameworkException : NSException

Exception raised by the framework which results in a test failure. To catch such exceptions, install a custom failure handler using EarlGrey::setFailureHandler:. A default failure handler is provided by the framework.

  • @remark init is not an available initializer. Use the other initializers.

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Creates a new exception instance.

    Declaration

    Objective-C

    + (nonnull instancetype)exceptionWithName:(nonnull NSString *)name
                                       reason:(nullable NSString *)reason;

    Swift

    convenience init(name: String, reason: String?)

    Parameters

    name

    The name of the exception.

    reason

    The reason for the exception.

    Return Value

    A GREYFrameworkException instance, initialized with a @c name and @c reason.

  • Creates a new exception instance.

    Declaration

    Objective-C

    + (nonnull instancetype)exceptionWithName:(nonnull NSString *)name
                                       reason:(nullable NSString *)reason
                                     userInfo:(nullable NSDictionary *)userInfo;

    Swift

    /*not inherited*/ init(name: String, reason: String?, userInfo: [AnyHashable : Any]? = nil)

    Parameters

    name

    The name of the exception.

    reason

    The reason for the exception.

    userInfo

    userInfo as used by @c NSException. EarlGrey doesn’t use this param so it’s safe to pass nil.

    Return Value

    A GREYFrameworkException instance, initialized with a @c name and @c reason.