diff --git a/src/Plugin/ProjectBrowserSource/DrupalDotOrgJsonApi.php b/src/Plugin/ProjectBrowserSource/DrupalDotOrgJsonApi.php index 84b22cd6f6b883e7ab2dfd00eb349b4e6784305d..6a2ef5f162ca90967dcb2dca1e378ebc8684d9e8 100644 --- a/src/Plugin/ProjectBrowserSource/DrupalDotOrgJsonApi.php +++ b/src/Plugin/ProjectBrowserSource/DrupalDotOrgJsonApi.php @@ -16,7 +16,6 @@ use Drupal\project_browser\ProjectBrowser\Project; use Drupal\project_browser\ProjectBrowser\ProjectsResultsPage; use GuzzleHttp\ClientInterface; use GuzzleHttp\Exception\GuzzleException; -use GuzzleHttp\Exception\RequestException; use Psr\Log\LoggerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Response; @@ -172,20 +171,13 @@ final class DrupalDotOrgJsonApi extends ProjectBrowserSourceBase { } } } - catch (RequestException $exception) { - $this->logger->error($exception->getMessage()); - $result['message'] = $exception->getMessage(); - $result['code'] = $exception->getCode(); - } - catch (GuzzleException $exception) { - $this->logger->error($exception->getMessage()); - $result['message'] = $exception->getMessage(); - $result['code'] = $exception->getCode(); - } catch (\Throwable $exception) { $this->logger->error($exception->getMessage()); - $result['message'] = $exception->getMessage(); - $result['code'] = Response::HTTP_INTERNAL_SERVER_ERROR; + $result['message'] = $this->t('An error occurred while fetching data from drupal.org. See the error log for details, or <a href="@report_issue">report the issue</a>. While this error persists, you can browse the <a href="@drupalorg_catalog">project catalog on drupal.org</a>.', [ + '@report_issue' => 'https://www.drupal.org/node/add/project-issue/drupalorg', + '@drupalorg_catalog' => 'https://www.drupal.org/project/project_module', + ]); + $result['code'] = $exception->getCode(); } return $result;