From cc4b998a2a3fe155d9c25a800e8ff43aff26ade9 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 11 Mar 2005 19:39:49 +0000 Subject: [PATCH] added some sanity checks git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@216 9efc2488-bf62-4759-914b-345cdb29e865 --- src/perlmods/OpenSRF/Application.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/perlmods/OpenSRF/Application.pm b/src/perlmods/OpenSRF/Application.pm index 87381ff..f1b2e7d 100644 --- a/src/perlmods/OpenSRF/Application.pm +++ b/src/perlmods/OpenSRF/Application.pm @@ -24,16 +24,19 @@ our @pending_requests; sub package { my $self = shift; + return 1 unless ref($self); return $self->{package}; } sub api_name { my $self = shift; + return 1 unless ref($self); return $self->{api_name}; } sub api_level { my $self = shift; + return 1 unless ref($self); return $self->{api_level}; } @@ -175,7 +178,7 @@ sub handler { my $start = time; my $response = $aref->[2]->run( $aref->[0], @{$aref->[1]} ); my $time = sprintf '%.3f', time - $start; - $log->debug( "Method duration for {[".$aref->[2]->name." -> ".join(', ',@{$aref->[1]}).'}: '.$time, DEBUG ); + $log->debug( "Method duration for {[".$aref->[2]->api_name." -> ".join(', ',@{$aref->[1]}).'}: '.$time, DEBUG ); $appreq = $aref->[0]; if( ref( $response ) ) { @@ -192,7 +195,7 @@ sub handler { $session->status( OpenSRF::DomainObject::oilsMethodException->new( statusCode => STATUS_INTERNALSERVERERROR(), - status => "Call to [".$aref->[2]->name."] faild: ".$e->{-text} + status => "Call to [".$aref->[2]->api_name."] faild: ".$e->{-text} ) ); }; -- 2.11.0