-
-
Save beelbrecht/998743ffa91501532f23 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "your/package", | |
"type": "typo3-flow-package", | |
// ... | |
"require": { | |
"raven/raven": "*" | |
}, | |
// ... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Your\Package\Error; | |
/* * | |
* This script belongs to the TYPO3 Flow package "Your.Package". * | |
* * | |
* */ | |
use TYPO3\Flow\Error\ProductionExceptionHandler; | |
/** | |
* Production Exception handler that reports exceptions to a configurable Sentry DSN using the raven library | |
*/ | |
class SentryExceptionHandler extends ProductionExceptionHandler { | |
/** | |
* @param \Exception $exception | |
* @return void | |
*/ | |
protected function echoExceptionWeb(\Exception $exception) { | |
if (isset($this->options['sentryDsn']) && strlen($this->options['sentryDsn']) > 0) { | |
$ravenClient = new \Raven_Client($this->options['sentryDsn']); | |
$ravenClient->captureException($exception); | |
} | |
parent::echoExceptionWeb($exception); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TYPO3: | |
Flow: | |
error: | |
exceptionHandler: | |
className: 'Your\Package\Error\SentryExceptionHandler' | |
# Sentry DSN (e.g. "http://public:[email protected]/1") | |
'sentryDsn': '' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment