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