コード例 #1
0
 public function testErrorsAreLoggedAsExceptions()
 {
     $client = $this->getMock('Client', array('captureException', 'getIdent'));
     $client->expects($this->once())->method('captureException')->with($this->isInstanceOf('ErrorException'));
     $handler = new Raven_ErrorHandler($client);
     $handler->handleError(E_WARNING, 'message');
 }
コード例 #2
0
ファイル: LogRoute.php プロジェクト: tatarko/yii-sentry
 /**
  * Send errors to sentry server
  * @param CErrorEvent $event represents the parameter for the onError event.
  * @return boolean
  */
 public function handleError($event)
 {
     if (!($sentry = $this->getClient())) {
         return false;
     }
     $this->_errorHandler->handleError($event->code, $event->message, $event->file, $event->line, $event->params);
     if ($lastError = $sentry->getLastError()) {
         Yii::log($lastError, CLogger::LEVEL_ERROR, $this->ravenLogCategory);
     }
     return true;
 }