Skip to content

Commit

Permalink
Add exit codes when failing.
Browse files Browse the repository at this point in the history
On mogdelete, mogfetch and moglistkeys when failing, it writes to STDERR
with there's an error, but it exits with 0. Change it to exist with an
error.

Signed-off-by: Eric Wong <[email protected]>
  • Loading branch information
Jesus Roncero authored and Eric Wong committed Dec 15, 2014
1 parent e605198 commit 9e208c7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mogdelete
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ my $mogc = $util->client;

$mogc->delete($c->{key});
if ($mogc->errcode) {
print STDERR "Error deleting file: ", $mogc->errstr, "\n";
die "Error deleting file: ", $mogc->errstr, "\n";
}
1 change: 1 addition & 0 deletions mogfetch
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,5 @@ if (@resses) {
print STDERR "Got errors while trying to fetch:\n";
print STDERR $res->status_line, "\n";
}
exit 1;
}
2 changes: 1 addition & 1 deletion moglistkeys
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ $mogc->foreach_key(prefix => $c->{key_prefix}, sub {
});

if ($mogc->errcode) {
print STDERR "Error listing files: ", $mogc->errstr, "\n";
die "Error listing files: ", $mogc->errstr, "\n";
}

0 comments on commit 9e208c7

Please sign in to comment.