Skip to content

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

Open
@kkmuffme

Description

@kkmuffme

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions