[libanyevent-rabbitmq-perl] 64/151: Explode loudly if the user is dumb

Damyan Ivanov dmn at moszumanska.debian.org
Thu Jan 16 11:03:04 UTC 2014


This is an automated email from the git hooks/post-receive script.

dmn pushed a commit to annotated tag debian/1.12-1
in repository libanyevent-rabbitmq-perl.

commit db4c9d54d49c3033bf23042a4a3897bfddf08ebf
Author: Tomas Doran <bobtfish at bobtfish.net>
Date:   Thu Sep 9 18:05:19 2010 +0100

    Explode loudly if the user is dumb
---
 lib/AnyEvent/RabbitMQ.pm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/AnyEvent/RabbitMQ.pm b/lib/AnyEvent/RabbitMQ.pm
index 705997f..6c92164 100644
--- a/lib/AnyEvent/RabbitMQ.pm
+++ b/lib/AnyEvent/RabbitMQ.pm
@@ -4,6 +4,7 @@ use strict;
 use warnings;
 
 use Data::Dumper;
+use Carp qw/ confess /;
 use List::MoreUtils qw(none);
 
 use AnyEvent::Handle;
@@ -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";
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libanyevent-rabbitmq-perl.git



More information about the Pkg-perl-cvs-commits mailing list