Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Exception.php

function Exception::factory

Factory method to create WebDriver\Exception objects

Parameters

integer $code Code:

string $message Message:

\Exception $previousException Previous exception:

Return value

\Exception

Overrides Exception::factory

11 calls to Exception::factory()
AbstractStorage::delete in vendor/lullabot/php-webdriver/lib/WebDriver/Storage/AbstractStorage.php
Delete storage or a specific key
AbstractStorage::get in vendor/lullabot/php-webdriver/lib/WebDriver/Storage/AbstractStorage.php
Get all keys from storage or a specific key/value pair
AbstractStorage::set in vendor/lullabot/php-webdriver/lib/WebDriver/Storage/AbstractStorage.php
Set specific key/value pair
AbstractWebDriver::assertSerializable in vendor/lullabot/php-webdriver/lib/WebDriver/AbstractWebDriver.php
Sanity check
AbstractWebDriver::curl in vendor/lullabot/php-webdriver/lib/WebDriver/AbstractWebDriver.php
Curl request to webdriver server.

... See full list

1 method overrides Exception::factory()
Exception::factory in vendor/lullabot/php-webdriver/lib/WebDriver/Exception.php
Factory method to create WebDriver\Exception objects

File

vendor/lullabot/php-webdriver/lib/WebDriver/Exception.php, line 179

Class

Exception
WebDriver\Exception class

Namespace

WebDriver

Code

public static function factory($code, $message = null, $previousException = null) {
    // unknown error
    if (!isset(self::$errs[$code])) {
        $code = self::UNKNOWN_ERROR;
    }
    $errorDefinition = self::$errs[$code];
    if ($message === null || trim($message) === '') {
        $message = $errorDefinition[1];
    }
    if (!is_numeric($code)) {
        $code = self::W3C_WEBDRIVER_ERROR;
    }
    $className = __CLASS__ . '\\' . $errorDefinition[0];
    return new $className($message, $code, $previousException);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal