示例#1
0
 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');
     }
 }
示例#2
0
文件: Client.php 项目: DbyD/cruk
 public function exceptionHandler($throwable)
 {
     if (!$this->config->autoNotify) {
         return;
     }
     $error = Bugsnag_Error::fromPHPThrowable($this->config, $this->diagnostics, $throwable);
     $error->setSeverity("error");
     $this->notify($error);
 }
示例#3
0
 public function setPrevious($exception)
 {
     if ($exception) {
         $this->previous = Bugsnag_Error::fromPHPThrowable($this->config, $this->diagnostics, $exception);
     }
     return $this;
 }