]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add -tolerant option to FreeSWITCH::Client init to only spew nasty warnings, but...
authorJustin Cassidy <xachen@mac.com>
Mon, 15 Oct 2007 17:16:45 +0000 (17:16 +0000)
committerJustin Cassidy <xachen@mac.com>
Mon, 15 Oct 2007 17:16:45 +0000 (17:16 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5877 d0543943-73ff-0310-b7d9-9358b9ac24b2

scripts/socket/FreeSWITCH/Client.pm

index bce8e762787451877d5a1b0df3f2acf4ed1bfda4..5945914a7eca7bb581591d27f8c7151690d6cf52 100644 (file)
@@ -13,6 +13,8 @@ sub init($;$) {
   $self->{_host} = $args->{-host} || "localhost";
   $self->{_port} = $args->{-port} || 8021;
   $self->{_password} = $args->{-password} || undef; 
+  $self->{_tolerant} = $args->{-tolerant} || false;
+
   $self->{events} = [];
   my $me = bless $self,$class;
   if (!$self->{_password}) {
@@ -94,7 +96,12 @@ sub readhash($;$) {
 
 sub error($$) {
   my($self,$error) = @_;
-  die $error;
+  if ($self->{"_tolerant"}) {
+      print "[DIE CROAKED] $error\n";
+  }
+  else {
+      die $error;
+  }
 }