Skip to content
Snippets Groups Projects
Commit c9585fa8 authored by Fran Garcia-Linares's avatar Fran Garcia-Linares Committed by Chris Wells
Browse files

Issue #3502465 by fjgarlin, phenaproxima, tim.plunkett: Reduce the amount of...

Issue #3502465 by fjgarlin, phenaproxima, tim.plunkett: Reduce the amount of information relayed on error by the DrupalOrgJsonApi plugin to the front-end
parent 570b190d
No related branches found
No related tags found
1 merge request!685Give generic error message for the front-end.
Pipeline #407388 passed with warnings
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment