Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CiviCRM Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
CiviCRM Core
Commits
ebace386
Unverified
Commit
ebace386
authored
2 years ago
by
colemanw
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #23765 from eileenmcnaughton/guzzle_it
Catch & convert Guzzle exception
parents
0c67d7e7
6d98068d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CRM/Extension/Browser.php
+11
-1
11 additions, 1 deletion
CRM/Extension/Browser.php
with
11 additions
and
1 deletion
CRM/Extension/Browser.php
+
11
−
1
View file @
ebace386
...
...
@@ -9,6 +9,8 @@
+--------------------------------------------------------------------+
*/
use
GuzzleHttp\Exception\GuzzleException
;
/**
* This class glues together the various parts of the extension
* system.
...
...
@@ -250,7 +252,15 @@ class CRM_Extension_Browser {
$url
=
$this
->
getRepositoryUrl
()
.
$this
->
indexPath
;
$client
=
$this
->
getGuzzleClient
();
$response
=
$client
->
request
(
'GET'
,
$url
,
[
'sink'
=>
$filename
,
'timeout'
=>
\Civi
::
settings
()
->
get
(
'http_timeout'
)]);
try
{
$response
=
$client
->
request
(
'GET'
,
$url
,
[
'sink'
=>
$filename
,
'timeout'
=>
\Civi
::
settings
()
->
get
(
'http_timeout'
),
]);
}
catch
(
GuzzleException
$e
)
{
throw
new
CRM_Extension_Exception
(
ts
(
'The CiviCRM public extensions directory at %1 could not be contacted - please check your webserver can make external HTTP requests'
,
[
1
=>
$this
->
getRepositoryUrl
()]),
'connection_error'
);
}
restore_error_handler
();
if
(
$response
->
getStatusCode
()
!==
200
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment