1
0
Fork 0

fixed 402 reponse error

This commit is contained in:
Arsen Mirzaev Tatyano-Muradovich 2025-03-08 20:42:39 +07:00
parent 1939387956
commit 12877873b7

View File

@ -283,7 +283,7 @@ final class interneturok extends core
// Exit (success) // Exit (success)
return ['downloads' => ['year' => $year], 'files' => $files]; return ['downloads' => ['year' => $year], 'files' => $files];
} }
} }
} }
} }
@ -811,16 +811,16 @@ final class interneturok extends core
// Exit (fail) // Exit (fail)
return false; return false;
}, },
function ($response) use ($homework) { function ($exception) use ($homework) {
if ($response->getStatusCode() === 402) { if ($exception->getResponse()?->getStatusCode() === 402) {
// Fail (received the "Payment Required" status code) // Fail (received the "Payment Required" status code)
// Writing into the output buffer // Writing into the output buffer
echo "Не удалось скачать домашнее задание $homework потому, что не оплачен тариф\n"; echo "Не удалось скачать домашнее задание $homework потому, что не оплачен тариф\n";
// Exit (fail)
return false;
} }
// Exit (fail)
return false;
} }
); );
} }