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

schedule:run -f ignores schedule's error handler #379

Open
drjayvee opened this issue Oct 22, 2021 · 2 comments
Open

schedule:run -f ignores schedule's error handler #379

drjayvee opened this issue Oct 22, 2021 · 2 comments

Comments

@drjayvee
Copy link
Contributor

Crunz version: 3.0.1

PHP version: 7.4.24

Operating system type and version: Ubuntu

Description
Force-running a schedule (schedule:run -f -t1) ignores the Schedule's error handler.

To reproduce

<?php
$sch = new Crunz\Schedule();
$sch->onError(function () {});  // will *not* be called
$sch->run(function () {};

return $sch;

Possible Solution
ScheduleRunCommand:115 seems to be the culprit. Before that section, $schedules[0] has the error handler closure. Afterwards, it's gone.

@PabloKowalczyk
Copy link
Collaborator

Hello, would you like to provide a PR?

@drjayvee
Copy link
Contributor Author

Hi Pablo,

We'll give it a try in our next tech-debt week next month.

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

2 participants