Returning error codes and messages corrected.

This commit is contained in:
tomas 2004-11-25 01:48:40 +00:00
parent c74555104f
commit d95c09c236
4 changed files with 40 additions and 7 deletions

View File

@ -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();

View File

@ -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
}

View File

@ -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", "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<methodResponse>
<fault>
<value>
<struct>
<member>
<name>faultCode</name>
<value><int>804</int></value>
</member>
<member>
<name>faultString</name>
<value><string>");
ini_set("error_append_string", "</string></value>
</member>
</struct>
</value>
</fault>
</methodResponse>");
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);

View File

@ -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)