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;
if ($pager['last'] !== $pager['current']) {
$nextPageUrl = $app['url_generator']->generate(
'networkData',
@@ -65,6 +66,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(
'repo' => $repo,

View File

@@ -351,7 +351,7 @@
}
function handleNoAvailableData() {
console.log('No Data available');
window.console && console.log('No (more) Data available');
}
var awaitedParents = {};