confess on all redis errors
[MQR.git] / scripts / mqr-irc-client.pl
index fab919a..58d4374 100755 (executable)
@@ -11,6 +11,7 @@ use AnyEvent::IRC::Client;
 use AnyEvent::IRC::Util qw/mk_msg parse_irc_msg encode_ctcp/;
 use AnyEvent::Redis;
 use Data::Dump qw(dump);
+use Carp qw(confess);
 
 my $nick = $ENV{IRC_NICK} || die "IRC_NICK";
 my $room = $ENV{IRC_ROOM} || die "IRC_ROOM";
@@ -21,8 +22,8 @@ my $c = AnyEvent->condvar;
 my $stdout = AnyEvent::Handle->new (fh => \*STDOUT);
 my $con = new AnyEvent::IRC::Client;
 
-my $pub = AnyEvent::Redis->new( host => $ENV{REDIS_HOST}, port => $ENV{REDIS_PORT}, on_error => sub { warn @_ } );
-my $sub = AnyEvent::Redis->new( host => $ENV{REDIS_HOST}, port => $ENV{REDIS_PORT}, on_error => sub { warn @_ } );
+my $pub = AnyEvent::Redis->new( host => $ENV{REDIS_HOST}, port => $ENV{REDIS_PORT}, on_error => sub { confess @_ } );
+my $sub = AnyEvent::Redis->new( host => $ENV{REDIS_HOST}, port => $ENV{REDIS_PORT}, on_error => sub { confess @_ } );
 
 $sub->psubscribe( 'channel *', sub {
        my ( $message, $from ) = @_;