Skip to content

Commit

Permalink
Explode loudly if the user is dumb
Browse files Browse the repository at this point in the history
  • Loading branch information
bobtfish committed Sep 28, 2010
1 parent ec13602 commit db4c9d5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/AnyEvent/RabbitMQ.pm
Expand Up @@ -4,6 +4,7 @@ use strict;
use warnings;

use Data::Dumper;
use Carp qw/ confess /;
use List::MoreUtils qw(none);

use AnyEvent::Handle;
Expand Down Expand Up @@ -58,6 +59,10 @@ sub connect {
$args{on_read_failure} ||= sub {warn @_, "\n"};
$args{timeout} ||= 0;

for (qw/ host port /) {
confess("No $_ passed to connect to") unless $args{$_};
}

if ($self->{verbose}) {
warn 'connect to ', $args{host}, ':', $args{port}, '...', "\n";
}
Expand Down

0 comments on commit db4c9d5

Please sign in to comment.