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

Airbrake\ErrorHandler reports errors that are suppressed with the @ operator #105

Open
fuhry opened this issue Jul 13, 2020 · 2 comments · May be fixed by #106
Open

Airbrake\ErrorHandler reports errors that are suppressed with the @ operator #105

fuhry opened this issue Jul 13, 2020 · 2 comments · May be fixed by #106
Labels

Comments

@fuhry
Copy link

fuhry commented Jul 13, 2020

Currently, if a PHP notice/warning/error occurs that is suppressed using the @ operator, the Airbrake ErrorHandler reports these errors as if they were not suppressed.

Reproduction steps:

$handler = new Airbrake\ErrorHandler($notifier);
$handler->register();

$foo = [];
echo @$foo[0]; // generates E_NOTICE

Expected result: no error is reported

Actual result: error is reported

fuhry added a commit to fuhry/phpbrake that referenced this issue Jul 13, 2020
If the error_reporting() setting has narrowed since Airbrake's error
handler was installed, respect the new setting. This also resolves the
issue of errors suppressed with the "@" operator being reported to
Airbrake. (Fixes airbrake#105)
@fuhry
Copy link
Author

fuhry commented Jul 13, 2020

Additionally - I've noticed that unit tests are actually enforcing this faulty behavior. Is this intentional?

    private function arrangeOnShutdownNotifier()
    {
        list($notifier, $handler) = $this->makeHandlerBoundNotifier();
        @Troublemaker::echoUndefinedVar();
        $handler->onShutdown();

        return $notifier;
    }

(edit: quoted source)

fuhry added a commit to fuhry/phpbrake that referenced this issue Jul 13, 2020
If the error_reporting() setting has narrowed since Airbrake's error
handler was installed, respect the new setting. This also resolves the
issue of errors suppressed with the "@" operator being reported to
Airbrake. (Fixes airbrake#105)
@fuhry fuhry linked a pull request Jul 13, 2020 that will close this issue
@destari destari added the bug label Jul 14, 2020
@scottsbaldwin scottsbaldwin removed their assignment Oct 10, 2023
@upsellpl
Copy link

@mmcdaris why it is still unmerged?

thompiler pushed a commit that referenced this issue Apr 18, 2024
If the error_reporting() setting has narrowed since Airbrake's error
handler was installed, respect the new setting. This also resolves the
issue of errors suppressed with the "@" operator being reported to
Airbrake. (Fixes #105)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants