Skip to content

Commit

Permalink
Added more logical processing of errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanwills-optus committed Aug 5, 2019
1 parent 2c413fd commit 885a8cc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/Group/Git/Stash.pm
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,13 @@ sub _repos {

while ($more) {
$mech->get( $url . $start );
my $response = eval { decode_json $mech->content }
or die $@ . "Possibly check your password\n";
my $response = eval { decode_json $mech->content };
if ( !$response ) {
die $@ || "Error occured processing stash server response\n";
}
elsif ( $response->{errors} ) {
die join '', map {"$_->{message}\n"} @{ $response->{errors} };
}

REPO:
for my $repo (@{ $response->{values} }) {
Expand Down

0 comments on commit 885a8cc

Please sign in to comment.