Skip to content

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

Merged
ste93cry merged 12 commits into
masterfrom
test-against-currrent-error-reporting-level
Mar 24, 2021
Merged

ste93cry merged 12 commits into
masterfrom
test-against-currrent-error-reporting-level

Conversation

@stayallive

@stayallive stayallive commented Mar 11, 2021 •

Copy link
Copy Markdown
Collaborator

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 requested review from Jean85 and ste93cry March 11, 2021 08:52
@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
Comment thread CHANGELOG.md Outdated
Comment thread tests/OptionsTest.php Outdated
Comment thread tests/OptionsTest.php Outdated
Comment thread tests/phpt/error_handler_respects_current_error_reporting_level.phpt Outdated
@stayallive
stayallive requested a review from Jean85 March 11, 2021 09:36
Comment thread tests/OptionsTest.php Outdated
@stayallive
stayallive requested a review from Jean85 March 11, 2021 10:51
Comment thread tests/OptionsTest.php Outdated
@stayallive
stayallive requested a review from ste93cry March 24, 2021 18:59
@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
Copy Markdown

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

@ste93cry

ste93cry commented Apr 6, 2021 •

Copy link
Copy Markdown
Contributor

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suppressed PHP warning is send to Sentry

4 participants