Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gnu-social
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
194
Issues
194
List
Boards
Labels
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gnu.io
gnu-social
Commits
99da1ebe
Commit
99da1ebe
authored
Jan 13, 2016
by
mmn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Catch NoHttpResponseException when using HTTPClient
parent
3ed632de
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
15 additions
and
20 deletions
+15
-20
lib/httpclient.php
lib/httpclient.php
+4
-7
plugins/Diaspora/DiasporaPlugin.php
plugins/Diaspora/DiasporaPlugin.php
+1
-1
plugins/GeoURL/GeoURLPlugin.php
plugins/GeoURL/GeoURLPlugin.php
+1
-1
plugins/Linkback/LinkbackPlugin.php
plugins/Linkback/LinkbackPlugin.php
+4
-6
plugins/OStatus/OStatusPlugin.php
plugins/OStatus/OStatusPlugin.php
+1
-1
plugins/OStatus/lib/feeddiscovery.php
plugins/OStatus/lib/feeddiscovery.php
+1
-1
plugins/RSSCloud/lib/rsscloudnotifier.php
plugins/RSSCloud/lib/rsscloudnotifier.php
+2
-2
scripts/importtwitteratom.php
scripts/importtwitteratom.php
+1
-1
No files found.
lib/httpclient.php
View file @
99da1ebe
...
...
@@ -27,12 +27,7 @@
* @link http://status.net/
*/
if
(
!
defined
(
'GNUSOCIAL'
))
{
exit
(
1
);
}
require_once
'HTTP/Request2.php'
;
require_once
'HTTP/Request2/Response.php'
;
if
(
!
defined
(
'GNUSOCIAL'
))
{
exit
(
1
);
}
/**
* Useful structure for HTTP responses
...
...
@@ -332,7 +327,7 @@ class HTTPClient extends HTTP_Request2
do
{
try
{
$response
=
parent
::
send
();
}
catch
(
HTTP_Request2_
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
$this
->
log
(
LOG_ERR
,
$e
->
getMessage
());
throw
$e
;
}
...
...
@@ -355,6 +350,8 @@ class HTTPClient extends HTTP_Request2
continue
;
}
catch
(
HTTP_Request2_Exception
$e
)
{
common_log
(
LOG_ERR
,
__CLASS__
.
": Invalid
$code
redirect from
$url
to
$target
"
);
}
catch
(
NoHttpResponseException
$e
)
{
common_log
(
LOG_ERR
,
__CLASS__
.
":
{
$e
->
getMessage
()
}
"
);
}
}
else
{
$reason
=
$response
->
getReasonPhrase
();
...
...
plugins/Diaspora/DiasporaPlugin.php
View file @
99da1ebe
...
...
@@ -240,7 +240,7 @@ class DiasporaPlugin extends Plugin
$client
=
new
HTTPClient
();
$client
->
setBody
(
'xml='
.
Magicsig
::
base64_url_encode
(
$envxml
));
$response
=
$client
->
post
(
$endpoint_uri
,
$headers
);
}
catch
(
HTTP_Request2_
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
common_log
(
LOG_ERR
,
"Diaspora-flavoured Salmon post to
$endpoint_uri
failed: "
.
$e
->
getMessage
());
return
false
;
}
...
...
plugins/GeoURL/GeoURLPlugin.php
View file @
99da1ebe
...
...
@@ -107,7 +107,7 @@ class GeoURLPlugin extends Plugin
$request
->
post
(
$this
->
ping
,
null
,
array
(
'p'
=>
$url
));
}
catch
(
HTTP_Request2_
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
common_log
(
LOG_WARNING
,
"GeoURL.org ping failed for '
$url
' (
$this->ping
)"
);
}
...
...
plugins/Linkback/LinkbackPlugin.php
View file @
99da1ebe
...
...
@@ -182,9 +182,8 @@ class LinkbackPlugin extends Plugin
common_log
(
LOG_WARNING
,
"Webmention request failed for '
$url
' (
$endpoint
)"
);
}
}
catch
(
HTTP_Request2_Exception
$e
)
{
common_log
(
LOG_WARNING
,
"Webmention request failed for '
$url
' (
$endpoint
)"
);
}
catch
(
Exception
$e
)
{
common_log
(
LOG_WARNING
,
"Webmention request failed for '
{
$url
}
' (
{
$endpoint
}
):
{
$e
->
getMessage
()
}
"
);
}
}
...
...
@@ -224,9 +223,8 @@ class LinkbackPlugin extends Plugin
"Pingback success for '
$url
' (
$endpoint
): "
.
"'
$response
'"
);
}
}
catch
(
HTTP_Request2_Exception
$e
)
{
common_log
(
LOG_WARNING
,
"Pingback request failed for '
$url
' (
$endpoint
)"
);
}
catch
(
Exception
$e
)
{
common_log
(
LOG_WARNING
,
"Pingback request failed for '
{
$url
}
' (
{
$endpoint
}
):
{
$e
->
getMessage
()
}
"
);
}
}
...
...
plugins/OStatus/OStatusPlugin.php
View file @
99da1ebe
...
...
@@ -1404,7 +1404,7 @@ class OStatusPlugin extends Plugin
$client
=
new
HTTPClient
();
$client
->
setBody
(
$envxml
);
$response
=
$client
->
post
(
$endpoint_uri
,
$headers
);
}
catch
(
HTTP_Request2_
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
common_log
(
LOG_ERR
,
"Salmon post to
$endpoint_uri
failed: "
.
$e
->
getMessage
());
return
false
;
}
...
...
plugins/OStatus/lib/feeddiscovery.php
View file @
99da1ebe
...
...
@@ -118,7 +118,7 @@ class FeedDiscovery
try
{
$client
=
new
HTTPClient
();
$response
=
$client
->
get
(
$url
);
}
catch
(
HTTP_Request2_
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
common_log
(
LOG_ERR
,
__METHOD__
.
" Failure for
$url
- "
.
$e
->
getMessage
());
throw
new
FeedSubBadURLException
(
$e
->
getMessage
());
}
...
...
plugins/RSSCloud/lib/rsscloudnotifier.php
View file @
99da1ebe
...
...
@@ -63,7 +63,7 @@ class RSSCloudNotifier
try
{
$client
=
new
HTTPClient
();
$response
=
$client
->
get
(
$url
);
}
catch
(
HTTP_Request2_
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
common_log
(
LOG_INFO
,
'RSSCloud plugin - failure testing notify handler '
.
$endpoint
.
' - '
.
$e
->
getMessage
());
...
...
@@ -118,7 +118,7 @@ class RSSCloudNotifier
try
{
$client
=
new
HTTPClient
();
$response
=
$client
->
post
(
$endpoint
,
$headers
,
$postdata
);
}
catch
(
HTTP_Request2_
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
common_log
(
LOG_INFO
,
'RSSCloud plugin - failure notifying '
.
$endpoint
.
' that feed '
.
$feed
.
' has changed: '
.
$e
->
getMessage
());
...
...
scripts/importtwitteratom.php
View file @
99da1ebe
...
...
@@ -108,7 +108,7 @@ function getTweetHtml($url)
try
{
$client
=
new
HTTPClient
();
$response
=
$client
->
get
(
$url
);
}
catch
(
HTTP_Request2_
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
print
"ERROR: HTTP response "
.
$e
->
getMessage
()
.
"
\n
"
;
return
false
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment