public function testPreviousException() { if (version_compare(PHP_VERSION, '5.3.0', '>=')) { $exception = new Exception("secondly", 65533, new Exception("firstly")); $error = Bugsnag_Error::fromPHPThrowable($this->config, $this->diagnostics, $exception); $errorArray = $error->toArray(); $this->assertEquals(count($errorArray['exceptions']), 2); $this->assertEquals($errorArray['exceptions'][0]['message'], 'firstly'); $this->assertEquals($errorArray['exceptions'][1]['message'], 'secondly'); } }
public function exceptionHandler($throwable) { if (!$this->config->autoNotify) { return; } $error = Bugsnag_Error::fromPHPThrowable($this->config, $this->diagnostics, $throwable); $error->setSeverity("error"); $this->notify($error); }
public function setPrevious($exception) { if ($exception) { $this->previous = Bugsnag_Error::fromPHPThrowable($this->config, $this->diagnostics, $exception); } return $this; }