sandreu / cake-sentry Goto Github PK
View Code? Open in Web Editor NEWHandle Sentry exceptions
Handle Sentry exceptions
Code in question:
cake-sentry/Lib/SentryErrorHandler.php
Lines 25 to 28 in c732172
// Avoid bot scan errors
if (($exception instanceof MissingControllerException || $exception instanceof MissingPluginException) && Configure::read('debug')==0) {
echo 'Cette url n\'est pas valide.';
exit(0);
}
I'd like to start a discussion to either remove this code or protect with a different Configure variable. My rational:
debug
of CakePHP in productionProbably the best course of action would be to make the exit
, if it must stay, dependable on configuration settings specific for the CakePHP sentry plugin. E.g. Sentry.avoidBotScanErrors
.
The same applies to SentryConsoleErrorHandler
, too.
thank you
Hi @Sandreu!
Thx for the awesome plugin. We introduced it couple of months ago and love the error/exception tracking via sentry. Without your plugin, initial setup would have taken much longer.
Nevertheless, there's an issue with Console Commands (./cake XY test). When adding SentryErrorHandler/ExceptionHandler as consoleHandler as well, the plugin itself sends an error to sentry.
here's my configuration:
Configure::write('Error', array(
'handler' => 'SentryErrorHandler::handleError',
'consoleHandler' => 'SentryErrorHandler::handleError',
'level' => E_ALL & ~E_DEPRECATED,
'trace' => true
));
Now, when producing a simple error like
App::uses('AppShell', 'Console/Command');
class XYShell extends AppShell {
public function test() {
pr([]['foo']);
die;
}
}
The error is correctly forwarded to sentry. But, unfortunately, another error is also forwarded. It looks like, parent::handleError is calling ErrorHandler::handleError, instead of ConsoleErrorHandler::handleError().
Because we have defined some session stuff in intializeXY(), the thrown warning looks like "session_start(): Cannot send session cache limiter - headers already sent (output started at โฆ"
I think, using SentryErrorHandler as a ConsoleErrorHandler should not need to create a Controller-class at all.
I tried to build another SentryConsoleErrroHandler, which extends ConsoleErrorHandler, but I received the "class ConsoleErrorHandler missing" error. ๐
Do you have any ideas for this problem?
Hi,
When I try to define Sentry as the error handler, I get that error :
2014/10/16 23:44:26 [error] 8914#0: *440 FastCGI sent in stderr: "PHP message: PHP Warning:
set_error_handler() expects the argument (SentryErrorHandler::handleError) to be a valid callback
Any advice ?
Hi,
We are downloading plugin "sandreu/cake-sentry": "0.1.0" using composer. So then we are seeing message - "Package raven/raven is abandoned, you should avoid using it. Use sentry/sentry instead." .
So we need to update "raven/raven" to "sentry/sentry" in composer.json. So could you please update this in release 0.1.0 if possible which should support CakePHP <= 2.3 ?
Thanks.
Hi Sandreu,
it would be cool, if you could make your repo available via packagist.
if you need help, please keep me posted.
Hi,
have the Plugin up-and-running and it looks very promising. But I did run into some problems during installation because I wasn't using "CakePlugin::loadAll();" in my bootstrap.php file. When I tried to load the library file in core.php, I got an error.
You should update your instructions to mention that the end-user needs to load the plugin in the bootstrap file, either by adding "CakePlugin::load('Sentry');" or "LoadAll()".
Thanks for creating this very helpful plugin.
Great plugin by the way!
When implementing the JavaScript code in the ReadMe, I get the following error:
"Unexpected token ("
on the line:
$.(function () {
Tried to change it to
jQuery(function(){
But I still don't get any JS error logging with Sentry.
Hello,
Is it possible to update the SDK version?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.