@@ -172,12 +172,23 @@ final class DrupalDotOrgJsonApi extends ProjectBrowserSourceBase {
}
}
catch(\Throwable$exception){
$this->logger->error($exception->getMessage());
$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 <a href="@drupalorg_catalog">browse modules on Drupal.org</a>.',[
$error_code=(int)$exception->getCode();
$this->logger->error('Error code: @error_code.<br>Message: @error_message.<br>You can report the issue <a href="@report_issue">in the Drupal.org issue queue</a>.',[
$reason=$this->t('An error occurred while fetching data from Drupal.org.');
if($error_code>=400&&$error_code<500){
$reason=($error_code===403)?
$this->t('The request made to Drupal.org is likely invalid or might have been blocked. Ensure you are running the latest version of Project Browser'):
$this->t('The request made to Drupal.org is likely invalid. Ensure you are running the latest version of Project Browser');
}
$result['message']=$this->t('@reason. See the error log for details. While this error persists, you can <a href="@drupalorg_catalog">browse modules on Drupal.org</a>.',[