コード例 #1
0
ファイル: rollbar.php プロジェクト: rohichurch/rohichurch-wp
 public static function report_exception($exc)
 {
     if (self::$instance == null) {
         return;
     }
     return self::$instance->report_exception($exc);
 }
コード例 #2
0
ファイル: rollbar.php プロジェクト: boboldehampsink/rollbar
 public static function report_exception($exc, $extra_data = null, $payload_data = null)
 {
     if (self::$instance == null) {
         return;
     }
     return self::$instance->report_exception($exc, $extra_data, $payload_data);
 }
コード例 #3
0
ファイル: RollbarHandler.php プロジェクト: ehough/epilog
 /**
  * {@inheritdoc}
  */
 protected function write(array $record)
 {
     if (isset($record['context']['exception']) && $record['context']['exception'] instanceof Exception) {
         $this->rollbarNotifier->report_exception($record['context']['exception']);
     } else {
         $extraData = array('level' => $record['level'], 'channel' => $record['channel'], 'datetime' => $record['datetime']->format('U'));
         $this->rollbarNotifier->report_message($record['message'], $record['level_name'], array_merge($record['context'], $record['extra'], $extraData));
     }
 }
コード例 #4
0
 /**
  * Report an exception to the rollbar.
  *
  * @param \Exception $exception
  * @param \Symfony\Component\HttpFoundation\Request $request
  * @param array $extraData
  * @return string UUID of rollbar item
  */
 public function report(Exception $exception, Request $request = null, $extraData = null)
 {
     if (false === $this->reportDecisionManager->decide($exception)) {
         return;
     }
     if (in_array(get_class($exception), $this->scrubExceptions)) {
         $exception = $this->scrubException($exception);
     }
     $this->prepareGlobalServer($request);
     $result = $this->rollbarNotifier->report_exception($exception, $extraData);
     $this->cleanGlobalServer();
     return $result;
 }
コード例 #5
0
 public function testExceptionWithInvalidConfig()
 {
     $config = self::$simpleConfig;
     $config['access_token'] = 'hello';
     $notifier = new RollbarNotifier($config);
     $result = 'dummy';
     try {
         throw new Exception("test exception");
     } catch (Exception $e) {
         $result = $notifier->report_exception($e);
     }
     $this->assertNull($result);
 }