Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal handler type check #161

Merged
merged 2 commits into from May 16, 2017
Merged

Conversation

vilius-g
Copy link
Contributor

@vilius-g vilius-g commented May 9, 2017

Since fatal error handler is connected to script shutdown function
and is executed after every script including ones without fatal errors,
error_get_last() might in some cases return last suppressed error that
was not caught by regular error handler. This causes it to be reported
when it should not be according to the configuration.

Steps to reproduce and get a reported occurrence on each script execution (which is a fun way to test your rate limits):

  1. Set included_errno to include E_NOTICE, like this: 'included_errno' => E_ALL
  2. Do not have git repository in project directory.
  3. Include Rollbar initialization in script and set $handleFatal to true (it is by default).
  4. Execute script.
  5. See E_NOTICE: Undefined offset: 0: Undefined offset: 0 reported for each execution. I did some digging, it is caused by https://github.com/rollbar/rollbar-php/blob/master/src/Defaults.php#L23

Since fatal error handler is connected to script shutdown function
and is executed after every script including ones without fatal errors,
error_get_last() might in some cases return last supressed error that
was not caught by regular error handler. This causes it to be reported
when it should not be according to the configuration.
@rokob
Copy link
Contributor

rokob commented May 16, 2017

LGTM

@rokob rokob merged commit f6b319c into rollbar:master May 16, 2017
rokob added a commit that referenced this pull request May 16, 2017
This issue was raised as repro steps in #161
Fix the bug that leads to an error. Also get rid of the error swallowing @ usage.
@vilius-g vilius-g deleted the fatal-handler-type-check branch August 24, 2017 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants