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

Fix error_reporting value not evaluated on the moment of the error being reported by default #1196

Merged
merged 12 commits into from
Mar 24, 2021

Conversation

stayallive
Copy link
Collaborator

@stayallive stayallive commented Mar 11, 2021

This PR aims to fix a bug where error_reporting() is copied on initialisation of the SDK and not evaluated on the moment of the error capture.

There are 2 changed to the behaviour of the SDK after this bug fix:

  • When not explicitly setting the error_types option on the SDK the error_reporting() value is used to determine if an error should be reported to Sentry
  • Errors silenced by the @ operator are reported regardless of their level, only taking capture_silenced_errors (defaults to false) into consideration

The last point is a side effect (IMO perfectly acceptable) because we cannot know the actual error reporting level while handling silenced (by the @ operator) errors because PHP temporarily modifies the error_reporting() level while handling such errors.

Fixes #1195.

@stayallive stayallive changed the title Fix error_reporting value not evaluated on the moment of the error being reported by default Fix error_reporting value not evaluated on the moment of the error being reported by default Mar 11, 2021
@Jean85 Jean85 added this to the 3.2 milestone Mar 11, 2021
CHANGELOG.md Outdated Show resolved Hide resolved
tests/OptionsTest.php Outdated Show resolved Hide resolved
tests/OptionsTest.php Outdated Show resolved Hide resolved
@stayallive stayallive requested a review from Jean85 March 11, 2021 09:36
tests/OptionsTest.php Outdated Show resolved Hide resolved
@stayallive stayallive requested a review from Jean85 March 11, 2021 10:51
tests/OptionsTest.php Outdated Show resolved Hide resolved
@ste93cry ste93cry merged commit 95fd4c2 into master Mar 24, 2021
@ste93cry ste93cry deleted the test-against-currrent-error-reporting-level branch March 24, 2021 19:30
@bobvandevijver
Copy link

@ste93cry Do you have any prediction on when this will be tagged and released?

@ste93cry
Copy link
Collaborator

ste93cry commented Apr 6, 2021

Released right now as 3.2.1, sorry for the delay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suppressed PHP warning is send to Sentry
4 participants