summaryrefslogtreecommitdiff
path: root/lib/githubexplorer/Repository.pm
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-02-10 11:03:30 +0100
committerfranck cuny <franck@lumberjaph.net>2010-02-10 11:03:30 +0100
commit9348a308ff54c046b242bd2fd8e572601ecc32ad (patch)
treedfd32de3fa700317aaf1cd5b13dbe62ec936c2c2 /lib/githubexplorer/Repository.pm
parentcheck error (diff)
downloadgithub-explorer-9348a308ff54c046b242bd2fd8e572601ecc32ad.tar.gz
small fix
Diffstat (limited to 'lib/githubexplorer/Repository.pm')
-rw-r--r--lib/githubexplorer/Repository.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/githubexplorer/Repository.pm b/lib/githubexplorer/Repository.pm
index 664d727..90adcd0 100644
--- a/lib/githubexplorer/Repository.pm
+++ b/lib/githubexplorer/Repository.pm
@@ -3,6 +3,7 @@ use 5.010;
use Moose::Role;
use Net::GitHub::V2::Repositories;
use YAML::Syck;
+use Try::Tiny;
sub fetch_repositories {
my ( $self, $profile ) = @_;
@@ -15,9 +16,9 @@ sub fetch_repositories {
my $repo_list = $github_profile->list();
- while ( ref $repo_list ne 'ARRAYREF' ) {
+ if ( ref $repo_list ne 'ARRAY' ) {
sleep(60);
- $repo_list = $github_profile->list();
+ return;
}
foreach my $repos (@$repo_list) {
@@ -41,9 +42,9 @@ sub fetch_repositories {
token => $self->api_token,
);
my $langs = $api_repos->languages;
- while ( ref $langs ne 'HASHREF' ) {
+ if ( ref $langs ne 'HASH' ) {
sleep(60);
- $langs = $api_repos->languages;
+ next;
}
foreach my $lang ( keys %$langs ) {