Permalink
Browse files

Merge remote branch 'bobtfish/master'

  • Loading branch information...
2 parents a8ad493 + e30432c commit bcbde73f7fb2e10007af702db7982f1ca72a3621 @cooldaemon committed Jul 15, 2010
Showing with 6 additions and 1 deletion.
  1. +2 −0 Makefile.PL
  2. +4 −1 lib/AnyEvent/RabbitMQ.pm
View
@@ -1,4 +1,6 @@
use inc::Module::Install;
+require Module::Install::TestBase;
+
name 'Net-RabbitFoot';
all_from 'lib/Net/RabbitFoot.pm';
@@ -67,7 +67,7 @@ sub connect {
$args{port},
sub {
my $fh = shift or return $args{on_failure}->(
- 'Error connecting to AMQP Server: ' . $!
+ sprintf('Error connecting to AMQP Server %s:%s: %s', $args{host}, $args{port}, $!)
);
$self->{_handle} = AnyEvent::Handle->new(
@@ -76,6 +76,9 @@ sub connect {
my ($handle, $fatal, $message) = @_;
$self->{_channels} = {};
+ if (!$self->{_is_open}) {
+ $args{on_failure}->(@_);
+ }
$self->{_is_open} = 0;
$self->_disconnect();
$args{on_close}->($message);

0 comments on commit bcbde73

Please sign in to comment.