Added Error Handling when no more commits are available

This commit is contained in:
Lukas Domnick
2013-09-13 08:01:12 +02:00
parent 0f686be509
commit 0ea9d0dfad
2 changed files with 14 additions and 1 deletions

View File

@@ -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,

View File

@@ -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 = {};