Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
0e86b0ee
Commit
0e86b0ee
authored
Jun 05, 2007
by
Donal McMullan
Browse files
Adapt client to recognise some HTTP response codes
parent
8dc3418b
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/api/xmlrpc/client.php
View file @
0e86b0ee
...
...
@@ -68,6 +68,17 @@ class Client {
$timestamp_send
=
time
();
$this
->
rawresponse
=
curl_exec
(
$ch
);
$response_code
=
curl_getinfo
(
$ch
,
CURLINFO_HTTP_CODE
);
$response_code_prefix
=
substr
(
$response_code
,
0
,
1
);
if
(
'2'
!=
$response_code_prefix
)
{
if
(
'4'
==
$response_code_prefix
)
{
throw
new
XmlrpcClientException
(
'Client error code: '
,
$response_code
);
}
elseif
(
'5'
==
$response_code_prefix
)
{
throw
new
XmlrpcClientException
(
'An error occurred at the remote server. Code: '
,
$response_code
);
}
}
$timestamp_receive
=
time
();
$remote_timestamp
=
null
;
...
...
Write
Preview
Supports
Markdown
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