From 2b07ba269a672e6fc8d9a97a240d22a78102f7e4 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 9 Dec 2005 16:09:27 +0000 Subject: [PATCH] for some reason, doing "throw $err $err->stringify" was causing a generic method exception to be thrown. Fixed by doing "throw $err". This should allow the /real/ error to be passed to the client, and not "method not found". Also cleaned up some other debugging info git-svn-id: svn://svn.open-ils.org/ILS/trunk@2301 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- OpenSRF/src/perlmods/OpenSRF/Application.pm | 16 ++++++++-------- .../OpenSRF/DomainObject/oilsResponse.pm | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/OpenSRF/src/perlmods/OpenSRF/Application.pm b/OpenSRF/src/perlmods/OpenSRF/Application.pm index 418f2e6203..99346c36f6 100644 --- a/OpenSRF/src/perlmods/OpenSRF/Application.pm +++ b/OpenSRF/src/perlmods/OpenSRF/Application.pm @@ -133,7 +133,9 @@ sub handler { my $resp; try { my $start = time(); + warn "About to run...\n"; $resp = $coderef->run( $appreq, @args); + warn "Done running...\n"; my $time = sprintf '%.3f', time() - $start; $log->debug( "Method duration for {$method_name}: ". $time, INFO ); if( defined( $resp ) ) { @@ -145,6 +147,8 @@ sub handler { } } catch Error with { my $e = shift; + warn "Caught error from 'run' method: $e\n"; + if(UNIVERSAL::isa($e,"Error")) { $e = $e->stringify(); } @@ -401,23 +405,19 @@ sub run { } catch Error with { my $e = shift; $err = $e; - warn "Caught Error in Application: $e\n"; - - if( UNIVERSAL::isa($e,"Error")) { - warn "Exception is:\n " . $e->stringify() . "\n"; - } + warn "Method 'run' catching error: $e\n"; if( ref($self) eq 'HASH') { - warn $self; $log->error("Sub $$self{package}::$$self{method} DIED!!!\n\t$e\n", ERROR); } }; if($err) { if(UNIVERSAL::isa($err,"Error")) { - throw $err ($err->stringify); + warn "Throwing from method run:\n$err\n------------------\n"; + throw $err; } else { - die $err; + die $err->stringify; } } diff --git a/OpenSRF/src/perlmods/OpenSRF/DomainObject/oilsResponse.pm b/OpenSRF/src/perlmods/OpenSRF/DomainObject/oilsResponse.pm index 6009032a05..673516bbdb 100644 --- a/OpenSRF/src/perlmods/OpenSRF/DomainObject/oilsResponse.pm +++ b/OpenSRF/src/perlmods/OpenSRF/DomainObject/oilsResponse.pm @@ -405,8 +405,8 @@ B =cut -$status = 'Method not found'; -$statusCode = STATUS_NOTFOUND; +$status = 'A server error occured during method execution'; +$statusCode = STATUS_INTERNALSERVERERROR; # ------------------------------------------- -- 2.43.2