You are here

class BrowserError in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/jcalderonzumba/gastonjs/src/Exception/BrowserError.php \Zumba\GastonJS\Exception\BrowserError

Class BrowserError @package Zumba\GastonJS\Exception

Hierarchy

  • class \Zumba\GastonJS\Exception\ClientError extends \Zumba\GastonJS\Exception\Exception

Expanded class hierarchy of BrowserError

2 files declare their use of BrowserError
BrowserBase.php in vendor/jcalderonzumba/gastonjs/src/Browser/BrowserBase.php
BrowserNavigateTrait.php in vendor/jcalderonzumba/gastonjs/src/Browser/BrowserNavigateTrait.php

File

vendor/jcalderonzumba/gastonjs/src/Exception/BrowserError.php, line 10

Namespace

Zumba\GastonJS\Exception
View source
class BrowserError extends ClientError {

  /**
   * @param array $response
   */
  public function __construct($response) {
    parent::__construct($response);
    $this->message = $this
      ->message();
  }

  /**
   * Gets the name of the browser error
   * @return string
   */
  public function getName() {
    return $this->response["error"]["name"];
  }

  /**
   * @return JSErrorItem
   */
  public function javascriptError() {

    //TODO: this need to be check, i don't know yet what comes in response
    return new JSErrorItem($this->response["error"]["args"][0], $this->response["error"]["args"][1]);
  }

  /**
   * Returns error message
   * TODO: check how to proper implement if we have exceptions
   * @return string
   */
  public function message() {
    return "There was an error inside the PhantomJS portion of GastonJS.\nThis is probably a bug, so please report it:\n" . $this
      ->javascriptError();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BrowserError::getName public function Gets the name of the browser error
BrowserError::javascriptError public function
BrowserError::message public function Returns error message TODO: check how to proper implement if we have exceptions
BrowserError::__construct public function Overrides ClientError::__construct
ClientError::$response protected property @var mixed
ClientError::getResponse public function
ClientError::setResponse public function