Better organize execution flow
This commit is contained in:
parent
273d2a93bc
commit
c8382eabb6
@ -52,16 +52,11 @@ my $json_response;
|
|||||||
eval {
|
eval {
|
||||||
|
|
||||||
$json_response = decode_json($response->content);
|
$json_response = decode_json($response->content);
|
||||||
print "JSON repsonse decoded successfully."
|
print "JSON repsonse decoded successfully.";
|
||||||
|
|
||||||
} or do {
|
$status = EXIT_OK;
|
||||||
print "Unable to decode JSON, invalid response?";
|
|
||||||
exit EXIT_CRITICAL;
|
|
||||||
};
|
|
||||||
|
|
||||||
$status = EXIT_OK;
|
if ($opts{d}) {
|
||||||
|
|
||||||
if ($opts{d}) {
|
|
||||||
|
|
||||||
if ( -e $opts{d}) {
|
if ( -e $opts{d}) {
|
||||||
|
|
||||||
@ -93,9 +88,14 @@ if ($opts{d}) {
|
|||||||
print "Unable to find data file $opts{d}";
|
print "Unable to find data file $opts{d}";
|
||||||
$status = EXIT_UNKNOWN;
|
$status = EXIT_UNKNOWN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
exit $status;
|
exit $status;
|
||||||
|
|
||||||
|
} or do {
|
||||||
|
print "Unable to decode JSON, invalid response?";
|
||||||
|
exit EXIT_CRITICAL;
|
||||||
|
};
|
||||||
|
|
||||||
sub HELP_MESSAGE
|
sub HELP_MESSAGE
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user