Skip to content

Commit 9bcabe1

Browse files
ENGCOM-9219: Report cron error message where possible #34069
- Merge Pull Request #34069 from fredden/magento2:better-cron-error-reporting - Merged commits: 1. a5da180 2. 098f258
2 parents 302f6c5 + 098f258 commit 9bcabe1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ function () use ($schedule) {
378378
);
379379
if (!$e instanceof \Exception) {
380380
$e = new \RuntimeException(
381-
'Error when running a cron job',
381+
'Error when running a cron job: ' . $e->getMessage(),
382382
0,
383383
$e
384384
);

app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ function ($callback) {
619619
*/
620620
public function dispatchExceptionInCallbackDataProvider(): array
621621
{
622-
$throwable = new TypeError();
622+
$throwable = new TypeError('Description of TypeError');
623623
return [
624624
'non-callable callback' => [
625625
'Not_Existed_Class',
@@ -642,11 +642,11 @@ public function dispatchExceptionInCallbackDataProvider(): array
642642
new CronJobException(
643643
$throwable
644644
),
645-
'Error when running a cron job',
645+
'Error when running a cron job: Description of TypeError',
646646
2,
647647
1,
648648
new \RuntimeException(
649-
'Error when running a cron job',
649+
'Error when running a cron job: Description of TypeError',
650650
0,
651651
$throwable
652652
)

0 commit comments

Comments
 (0)