From: Justin Cassidy Date: Mon, 15 Oct 2007 17:16:45 +0000 (+0000) Subject: add -tolerant option to FreeSWITCH::Client init to only spew nasty warnings, but... X-Git-Tag: v1.0-beta2~489 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=557660ca4f8d620ed518baf4a516945cf4c195c0;p=thirdparty%2Ffreeswitch.git add -tolerant option to FreeSWITCH::Client init to only spew nasty warnings, but not intentionally kill the script git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5877 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/scripts/socket/FreeSWITCH/Client.pm b/scripts/socket/FreeSWITCH/Client.pm index bce8e76278..5945914a7e 100644 --- a/scripts/socket/FreeSWITCH/Client.pm +++ b/scripts/socket/FreeSWITCH/Client.pm @@ -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; + } }