Skip to content

Commit a5da180

Browse files
committed
Report cron error message where possible
1 parent f0f779a commit a5da180

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
@@ -366,7 +366,7 @@ function () use ($schedule) {
366366
);
367367
if (!$e instanceof \Exception) {
368368
$e = new \RuntimeException(
369-
'Error when running a cron job',
369+
'Error when running a cron job: ' . $e->getMessage(),
370370
0,
371371
$e
372372
);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ function ($callback) {
617617
*/
618618
public function dispatchExceptionInCallbackDataProvider(): array
619619
{
620-
$throwable = new TypeError();
620+
$throwable = new TypeError('Description of TypeError');
621621
return [
622622
'non-callable callback' => [
623623
'Not_Existed_Class',
@@ -640,11 +640,11 @@ public function dispatchExceptionInCallbackDataProvider(): array
640640
new CronJobException(
641641
$throwable
642642
),
643-
'Error when running a cron job',
643+
'Error when running a cron job: Description of TypeError',
644644
2,
645645
1,
646646
new \RuntimeException(
647-
'Error when running a cron job',
647+
'Error when running a cron job: Description of TypeError',
648648
0,
649649
$throwable
650650
)

0 commit comments

Comments
 (0)