public static function report_exception($exc) { if (self::$instance == null) { return; } return self::$instance->report_exception($exc); }
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); }
/** * {@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)); } }
/** * 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; }
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); }