Mercurial > hg > isophonics-drupal-site
view vendor/jcalderonzumba/gastonjs/src/Exception/BrowserError.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 4c8ae668cc8c |
children |
line wrap: on
line source
<?php namespace Zumba\GastonJS\Exception; /** * Class BrowserError * @package Zumba\GastonJS\Exception */ 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(); } }