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

Do not interfere with errors that were suppressed by the @ operator. #388

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

netpalantir
Copy link
Contributor

While working on a legacy project, I noticed that execution threw a different set of error when Ignition was enabled. I noticed that the project makes use of the "@" operator, which suppresses some errors. Ignition is not taking this into consideration, and it will throw new exceptions even for suppressed errors.

This is because when you register an error handler, it will fire regardless of error suppressions, and one should check for a magic error_reporting value to detect that it was indeed suppressed. If the error is not being suppressed, then this value will be -1, as we set it originally.

My code checks for that special value, and if it finds it it return immediately, so Ignition does not fire.

@guiiamorim
Copy link

I would like to see this merged, just fixed an error on a legacy app that I installed ignition on. Had to extend the Ignition class into a custom class and override some of the methods to make it work with @include and @filemtime.

@AlexVanderbist
Copy link
Member

Awesome, thanks for the great PR with tests!

@AlexVanderbist AlexVanderbist merged commit d34740b into spatie:main Feb 1, 2024
15 of 16 checks passed
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.

3 participants