コード例 #1
0
 /**
  * Handles exceptions thrown during rendering of content objects
  * The handler can decide whether to re-throw the exception or
  * return a nice error message for production context.
  *
  * @param \Exception $exception
  * @param AbstractContentObject $contentObject
  * @param array $contentObjectConfiguration
  * @return string
  */
 public function handle(\Exception $exception, AbstractContentObject $contentObject = NULL, $contentObjectConfiguration = array())
 {
     $this->ravenErrorHandler->handleException($exception, TRUE);
     $extConf = @unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['sentry']);
     if ($extConf['passErrorsToTypo3']) {
         parent::handle($exception, $contentObject, $contentObjectConfiguration);
     }
 }
コード例 #2
0
 public function testExceptionsAreLogged()
 {
     $client = $this->getMock('Client', array('captureException', 'getIdent'));
     $client->expects($this->once())->method('captureException')->with($this->isInstanceOf('ErrorException'));
     $e = new ErrorException('message', 0, E_WARNING, '', 0);
     $handler = new Raven_ErrorHandler($client);
     $handler->handleException($e);
 }
コード例 #3
0
 /**
  * Exception Handler
  *
  * @param Exception $exception Exception to handle
  * @return void
  */
 public function handle(Exception $exception)
 {
     if (!Configure::read('CakeMonitor.Sentry.enabled') || error_reporting() === 0) {
         return false;
     }
     $errorHandler = new \Raven_ErrorHandler($this->_ravenClient);
     $errorHandler->registerShutdownFunction();
     $errorHandler->handleException($exception);
 }
コード例 #4
0
ファイル: LogRoute.php プロジェクト: tatarko/yii-sentry
 /**
  * Send exceptions to sentry server
  * @param \CExceptionEvent $event represents the parameter for the 
  * onException event.
  * @return boolean
  */
 public function handleException($event)
 {
     if (!($sentry = $this->getClient())) {
         return false;
     }
     $this->_errorHandler->handleException($event->exception);
     $this->eventId = $event->exception->event_id;
     if ($lastError = $sentry->getLastError()) {
         Yii::log($lastError, CLogger::LEVEL_ERROR, $this->ravenLogCategory);
     }
     return true;
 }