mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
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
This commit is contained in:
@@ -13,6 +13,8 @@ sub init($;$) {
|
|||||||
$self->{_host} = $args->{-host} || "localhost";
|
$self->{_host} = $args->{-host} || "localhost";
|
||||||
$self->{_port} = $args->{-port} || 8021;
|
$self->{_port} = $args->{-port} || 8021;
|
||||||
$self->{_password} = $args->{-password} || undef;
|
$self->{_password} = $args->{-password} || undef;
|
||||||
|
$self->{_tolerant} = $args->{-tolerant} || false;
|
||||||
|
|
||||||
$self->{events} = [];
|
$self->{events} = [];
|
||||||
my $me = bless $self,$class;
|
my $me = bless $self,$class;
|
||||||
if (!$self->{_password}) {
|
if (!$self->{_password}) {
|
||||||
@@ -94,8 +96,13 @@ sub readhash($;$) {
|
|||||||
|
|
||||||
sub error($$) {
|
sub error($$) {
|
||||||
my($self,$error) = @_;
|
my($self,$error) = @_;
|
||||||
|
if ($self->{"_tolerant"}) {
|
||||||
|
print "[DIE CROAKED] $error\n";
|
||||||
|
}
|
||||||
|
else {
|
||||||
die $error;
|
die $error;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
sub output($$) {
|
sub output($$) {
|
||||||
|
Reference in New Issue
Block a user