mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-71329 tool_moodlenet: Check to see if we get errors before curl
This commit is contained in:
parent
9600becce3
commit
37a80759ea
1 changed files with 1 additions and 2 deletions
|
@ -310,11 +310,10 @@ class profile_manager {
|
||||||
'CURLOPT_HEADER' => 0,
|
'CURLOPT_HEADER' => 0,
|
||||||
];
|
];
|
||||||
$content = $curl->get($url, null, $options);
|
$content = $curl->get($url, null, $options);
|
||||||
$errno = $curl->get_errno();
|
|
||||||
$info = $curl->get_info();
|
$info = $curl->get_info();
|
||||||
|
|
||||||
// The base cURL seems fine, let's press on.
|
// The base cURL seems fine, let's press on.
|
||||||
if (!$errno) {
|
if (!$curl->get_errno() && !$curl->error) {
|
||||||
// WebFinger gave us a 404 back so the user has no droids here.
|
// WebFinger gave us a 404 back so the user has no droids here.
|
||||||
if ($info['http_code'] >= 400) {
|
if ($info['http_code'] >= 400) {
|
||||||
if ($info['http_code'] === 404) {
|
if ($info['http_code'] === 404) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue