mirror of
https://github.com/joomla-extensions/patchtester.git
synced 2024-12-23 03:19:00 +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
|
||||
$github = Helper::initializeGithub();
|
||||
$rate = $github->authorization->getRateLimit();
|
||||
|
||||
try
|
||||
{
|
||||
$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 ($rate->resources->core->remaining < 10)
|
||||
|
Loading…
Reference in New Issue
Block a user