mirror of
https://github.com/klaussilveira/gitlist.git
synced 2025-11-17 19:20:56 +01:00
Added Error Handling when no more commits are available
This commit is contained in:
@@ -55,6 +55,7 @@ class NetworkController implements ControllerProviderInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
$nextPageUrl = null;
|
$nextPageUrl = null;
|
||||||
|
|
||||||
if ($pager['last'] !== $pager['current']) {
|
if ($pager['last'] !== $pager['current']) {
|
||||||
$nextPageUrl = $app['url_generator']->generate(
|
$nextPageUrl = $app['url_generator']->generate(
|
||||||
'networkData',
|
'networkData',
|
||||||
@@ -66,6 +67,18 @@ class NetworkController implements ControllerProviderInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// when no commits are given, return an empty response - issue #369
|
||||||
|
if( count($commits) === 0 ) {
|
||||||
|
return $app->json( array(
|
||||||
|
'repo' => $repo,
|
||||||
|
'commitishPath' => $commitishPath,
|
||||||
|
'nextPage' => null,
|
||||||
|
'start' => null,
|
||||||
|
'commits' => $jsonFormattedCommits
|
||||||
|
), 200
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return $app->json( array(
|
return $app->json( array(
|
||||||
'repo' => $repo,
|
'repo' => $repo,
|
||||||
'commitishPath' => $commitishPath,
|
'commitishPath' => $commitishPath,
|
||||||
|
|||||||
@@ -351,7 +351,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleNoAvailableData() {
|
function handleNoAvailableData() {
|
||||||
console.log('No Data available');
|
window.console && console.log('No (more) Data available');
|
||||||
}
|
}
|
||||||
|
|
||||||
var awaitedParents = {};
|
var awaitedParents = {};
|
||||||
|
|||||||
Reference in New Issue
Block a user