diff options
author | Daniel Friesel <derf@finalrewind.org> | 2012-04-15 10:30:23 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2012-04-15 10:30:23 +0200 |
commit | 43d723eeb32041b612d9d1d2aa9bbdb4a170f4d0 (patch) | |
tree | f2c2fa2d2cc6c02d34c8764065fcff5fa0b83104 /bin/icli | |
parent | b387a54a39bfb4fc51b0aec7c0f7acca67b188c6 (diff) |
Use croak, fix tests
Diffstat (limited to 'bin/icli')
-rwxr-xr-x | bin/icli | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -7,6 +7,7 @@ use strict; use warnings; use 5.010; +use Carp qw(croak); use Date::Format; use Getopt::Long qw/:config bundling/; use Term::ANSIColor; @@ -364,7 +365,7 @@ sub service_state { when (1) { return with_colour( ' WARNING', 'black on_yellow' ) } when (2) { return with_colour( 'CRITICAL', 'white on_red' ) } when (3) { return with_colour( ' UNKNOWN', 'white on_blue' ) } - default { die("Unknown service state: $digit\n") } + default { croak("Unknown service state: $digit\n") } } } @@ -379,7 +380,7 @@ sub host_state { when (0) { return with_colour( ' OK ', 'black on_green' ) } when (1) { return with_colour( ' DOWN ', 'white on_red' ) } when (2) { return with_colour( 'UNREACHABLE', 'white on_blue' ) } - default { die("Unknown host state: $digit\n") } + default { croak("Unknown host state: $digit\n") } } } |