Skip to content

Commit

Permalink
Fix error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mickenordin committed Oct 24, 2016
1 parent 837359a commit 8701400
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Thruk/Controller/api_conf.pm
Original file line number Diff line number Diff line change
Expand Up @@ -979,14 +979,14 @@ sub commands {
} elsif ($submit eq "Submit" and $command =~ m/.+/ and $commandline =~ m/.+/ ) {
my $mess = 'Are you sure you want to create ' . $command . ' with commandline: ' . $commandline;
$mess .= $arguments =~ m/.+/ ? " and arguments: $arguments?<br>" : "?<br>";
my $all_is_well = 0;
my $all_is_well = 1;
unless( is_valid_json $arguments or $arguments eq "") {
$command_page .= "<p>You supplied faulty json.</p>";
$all_is_well = 1;
$all_is_well = 0;
}
unless ( basename ($commandline) =~ m/^check_/ ) {
$command_page .= "<p>Basename of your commandline must start with check_, e.g.: /usr/local/bin/check_test. Please try again.</p>";
$all_is_well = 1;
$all_is_well = 0;
}
if ($all_is_well){
$command_page .= $q->p($mess);
Expand Down

0 comments on commit 8701400

Please sign in to comment.