class RemoveExceptionFrameVarsIntegration in Raven: Sentry Integration 3.x
Removes function calling arguments from exception stack frames.
Hierarchy
- class \Drupal\raven\Integration\RemoveExceptionFrameVarsIntegration implements \Sentry\Integration\IntegrationInterface
Expanded class hierarchy of RemoveExceptionFrameVarsIntegration
File
- src/
Integration/ RemoveExceptionFrameVarsIntegration.php, line 16
Namespace
Drupal\raven\IntegrationView source
class RemoveExceptionFrameVarsIntegration implements IntegrationInterface {
/**
* {@inheritdoc}
*/
public function setupOnce() : void {
Scope::addGlobalEventProcessor(function (Event $event) : Event {
$currentHub = SentrySdk::getCurrentHub();
$integration = $currentHub
->getIntegration(self::class);
$client = $currentHub
->getClient();
// The client bound to the current hub, if any, could not have this
// integration enabled. If this is the case, bail out.
if (NULL === $integration || NULL === $client) {
return $event;
}
$this
->processEvent($event, $client
->getOptions());
return $event;
});
}
/**
* {@inheritdoc}
*/
private function processEvent(Event $event, Options $options) : void {
// Remove function calling arguments from exception stack frames.
foreach ($event
->getExceptions() as $exception) {
foreach ($exception
->getStacktrace()
->getFrames() as $frame) {
$frame
->setVars([]);
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RemoveExceptionFrameVarsIntegration:: |
private | function | ||
RemoveExceptionFrameVarsIntegration:: |
public | function |