mirror of
https://github.com/joomla-extensions/patchtester.git
synced 2025-01-11 01:32:05 +00:00
Missed on try/catch
This commit is contained in:
parent
a56f449eb5
commit
23aa89ae9d
@ -44,7 +44,23 @@ class StartfetchController extends DisplayController
|
|||||||
|
|
||||||
// Make sure we can fetch the data from GitHub - throw an error on < 10 available requests
|
// Make sure we can fetch the data from GitHub - throw an error on < 10 available requests
|
||||||
$github = Helper::initializeGithub();
|
$github = Helper::initializeGithub();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
$rate = $github->authorization->getRateLimit();
|
$rate = $github->authorization->getRateLimit();
|
||||||
|
}
|
||||||
|
catch (\Exception $e)
|
||||||
|
{
|
||||||
|
$response = new \JResponseJson(
|
||||||
|
new \Exception(
|
||||||
|
\JText::sprintf('COM_PATCHTESTER_COULD_NOT_CONNECT_TO_GITHUB', $e->getMessage())
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
echo json_encode($response);
|
||||||
|
|
||||||
|
$this->getApplication()->close(1);
|
||||||
|
}
|
||||||
|
|
||||||
// If over the API limit, we can't build this list
|
// If over the API limit, we can't build this list
|
||||||
if ($rate->resources->core->remaining < 10)
|
if ($rate->resources->core->remaining < 10)
|
||||||
|
Loading…
Reference in New Issue
Block a user