Skip to content

Arbitrary failed action due to inconsistent error/exception handling #1252

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

Open
kkmuffme opened this issue Mar 27, 2025 · 0 comments
Open

Arbitrary failed action due to inconsistent error/exception handling #1252

kkmuffme opened this issue Mar 27, 2025 · 0 comments

Comments

@kkmuffme
Copy link

https://github.com/woocommerce/action-scheduler/blob/dba9377f26daea2da114b33ddf1431a3550dfb3d/classes/abstracts/ActionScheduler_Abstract_QueueRunner.php

The handling/reporting of failed tasks due to PHP errors and exceptions is completely arbitrary.
e.g.
if an action callback runs preg_match( 'invalid', 'abc' ); it reports an E_WARNING (actually PHP error logs it, since the error handler of as doesn't include that error type) but the action is not reported as failed.

if an action callback runs e.g.

function foo( string $a ) {}
foo( null );

it will catch the throwable and report it as failed.

As #1247 correctly states, error handling can be simplified a lot, but first it has to be decided what actually should count as failure

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

No branches or pull requests

1 participant