diff --git a/Classes/Command/CheckPageSpeedInsightsCommand.php b/Classes/Command/CheckPageSpeedInsightsCommand.php
index db1ff1c..141152c 100644
--- a/Classes/Command/CheckPageSpeedInsightsCommand.php
+++ b/Classes/Command/CheckPageSpeedInsightsCommand.php
@@ -27,6 +27,7 @@ public function configure(): void
public function execute(InputInterface $input, OutputInterface $output)
{
$reference = 'command-' . time();
+ $errors = 0;
$queryBuilderPages = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('pages')->createQueryBuilder();
$result = $queryBuilderPages
@@ -48,10 +49,22 @@ public function execute(InputInterface $input, OutputInterface $output)
$strategies = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['page_speed_insights']['strategies'] ?: ['performance', 'seo', 'accessibility', 'best-practices', 'pwa'];
$pageSpeedInsightsResultsMobile = PageSpeedInsightsUtility::checkUrl($url, 'mobile', $strategies, $reference, $pageId, $languageId, $pid, (string)$input->getArgument('key'));
+ if (array_key_exists('error', $pageSpeedInsightsResultsMobile)) {
+ $errors = 10;
+ $output->writeln('' . $row['uid'] . ': Check for ' . $url . ' failed for mobile. Error message: ' . $pageSpeedInsightsResultsMobile['error']['message'] . '');
+ } else {
+ $output->writeln($row['uid'] . ': ' . $row['slug'] . ': ' . $url . ' (' . implode(', ', $strategies) . ') succeeded for mobile');
+ }
+
$pageSpeedInsightsResultsDesktop = PageSpeedInsightsUtility::checkUrl($url, 'desktop', $strategies, $reference, $pageId, $languageId, $pid, (string)$input->getArgument('key'));
- $output->writeln($row['uid'] . ': ' . $row['slug'] . ': ' . $url . ' (' . implode(', ', $strategies) . ')');
+ if (array_key_exists('error', $pageSpeedInsightsResultsDesktop)) {
+ $errors = 10;
+ $output->writeln('' . $row['uid'] . ': Check for ' . $url . ' failed for desktop. Error message: ' . $pageSpeedInsightsResultsDesktop['error']['message'] . '');
+ } else {
+ $output->writeln($row['uid'] . ': ' . $row['slug'] . ': ' . $url . ' (' . implode(', ', $strategies) . ') succeeded for desktop');
+ }
}
- return 0;
+ return $errors;
}
}