From d95c09c236233c99cfeb23c9a1918ef466fcee18 Mon Sep 17 00:00:00 2001 From: tomas Date: Thu, 25 Nov 2004 01:48:40 +0000 Subject: [PATCH] Returning error codes and messages corrected. --- .../storageServer/var/install/uninstall.php | 4 +-- .../storageServer/var/xmlrpc/testRunner.sh | 5 +-- .../storageServer/var/xmlrpc/xrLocStor.php | 33 ++++++++++++++++++- .../storageServer/var/xmlrpc/xr_cli_test.py | 5 +-- 4 files changed, 40 insertions(+), 7 deletions(-) diff --git a/livesupport/modules/storageServer/var/install/uninstall.php b/livesupport/modules/storageServer/var/install/uninstall.php index ca46bd035..11e1207e2 100644 --- a/livesupport/modules/storageServer/var/install/uninstall.php +++ b/livesupport/modules/storageServer/var/install/uninstall.php @@ -23,7 +23,7 @@ Author : $Author: tomas $ - Version : $Revision: 1.3 $ + Version : $Revision: 1.4 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/install/uninstall.php,v $ ------------------------------------------------------------------------------*/ @@ -59,7 +59,7 @@ $gb = &new GreenBox(&$dbc, $config); echo "# Trying to uninstall storageServer ...\n"; $gb->uninstall(); -echo "# Uninstall Tranport submodule ...\n"; +echo "# Uninstall Transport submodule ...\n"; require_once "../Transport.php"; $tr =& new Transport(&$dbc, $config); $r = $tr->uninstall(); diff --git a/livesupport/modules/storageServer/var/xmlrpc/testRunner.sh b/livesupport/modules/storageServer/var/xmlrpc/testRunner.sh index efbdc6ccf..022b98146 100755 --- a/livesupport/modules/storageServer/var/xmlrpc/testRunner.sh +++ b/livesupport/modules/storageServer/var/xmlrpc/testRunner.sh @@ -23,7 +23,7 @@ # # # Author : $Author: tomas $ -# Version : $Revision: 1.5 $ +# Version : $Revision: 1.6 $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/testRunner.sh,v $ #------------------------------------------------------------------------------- @@ -70,7 +70,8 @@ storeAudioClip() { echo -n "# storeAudioClip: " MEDIA=../tests/ex1.mp3 METADATA=../tests/testStorage.xml - RGUNID=`$XR_CLI storeAudioClip "$SESSID" '' "$MEDIA" "$METADATA"` || exit $? + RGUNID=`$XR_CLI storeAudioClip "$SESSID" '' "$MEDIA" "$METADATA"` || \ + { ERN=$?; echo $RGUNID; exit $ERN; } echo $RGUNID } diff --git a/livesupport/modules/storageServer/var/xmlrpc/xrLocStor.php b/livesupport/modules/storageServer/var/xmlrpc/xrLocStor.php index 0f4d2bbfe..45cc71914 100644 --- a/livesupport/modules/storageServer/var/xmlrpc/xrLocStor.php +++ b/livesupport/modules/storageServer/var/xmlrpc/xrLocStor.php @@ -23,16 +23,47 @@ Author : $Author: tomas $ - Version : $Revision: 1.3 $ + Version : $Revision: 1.4 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/xrLocStor.php,v $ ------------------------------------------------------------------------------*/ +error_reporting(0); +ini_set("error_prepend_string", " + + + + + +faultCode +804 + + +faultString +"); +ini_set("error_append_string", " + + + + +"); +header("Content-type: text/xml"); + include_once "xmlrpc.inc"; include_once "xmlrpcs.inc"; require_once '../conf.php'; require_once 'DB.php'; require_once '../LocStor.php'; +function errHndl($errno, $errmsg, $filename, $linenum, $vars){ + if($errno == 8 /*E_NOTICE*/) return; + $xr =& new xmlrpcresp(0, 805, + "ERROR:xrLoctor: $errno $errmsg ($filename:$linenum)\n"); + header("Content-type: text/xml"); + echo $xr->serialize(); + exit($errno); +} +$old_error_handler = set_error_handler("errHndl"); + PEAR::setErrorHandling(PEAR_ERROR_RETURN); $dbc = DB::connect($config['dsn'], TRUE); $dbc->setFetchMode(DB_FETCHMODE_ASSOC); diff --git a/livesupport/modules/storageServer/var/xmlrpc/xr_cli_test.py b/livesupport/modules/storageServer/var/xmlrpc/xr_cli_test.py index 30b9f6b26..9cef51666 100755 --- a/livesupport/modules/storageServer/var/xmlrpc/xr_cli_test.py +++ b/livesupport/modules/storageServer/var/xmlrpc/xr_cli_test.py @@ -24,7 +24,7 @@ # # # Author : $Author: tomas $ -# Version : $Revision: 1.1 $ +# Version : $Revision: 1.2 $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/Attic/xr_cli_test.py,v $ # #------------------------------------------------------------------------------ @@ -109,4 +109,5 @@ try: print "Unknown command: "+method sys.exit(1) except Error, v: - print "XML-RPC Error:",v +# print "XML-RPC Error:",v + sys.exit(v)