3 namespace Zumba\GastonJS\Exception;
8 * @package Zumba\GastonJS\Exception
10 class BrowserError extends ClientError {
13 * @param array $response
15 public function __construct($response) {
16 parent::__construct($response);
17 $this->message = $this->message();
21 * Gets the name of the browser error
24 public function getName() {
25 return $this->response["error"]["name"];
31 public function javascriptError() {
32 //TODO: this need to be check, i don't know yet what comes in response
33 return new JSErrorItem($this->response["error"]["args"][0], $this->response["error"]["args"][1]);
37 * Returns error message
38 * TODO: check how to proper implement if we have exceptions
41 public function message() {
42 return "There was an error inside the PhantomJS portion of GastonJS.\nThis is probably a bug, so please report it:\n" . $this->javascriptError();