summaryrefslogtreecommitdiff
path: root/pear/PEAR/Remote.php
diff options
context:
space:
mode:
authorStig Bakken <ssb@php.net>2001-10-31 06:21:11 +0000
committerStig Bakken <ssb@php.net>2001-10-31 06:21:11 +0000
commit8a7f7d5cae209c699f335a57d64c8dde8979392e (patch)
tree17bdb031c2075dd1f903ce4216bcfd4799a7ab20 /pear/PEAR/Remote.php
parentb0a803d12788243b3ed5c0064d2cc1711588f7c4 (diff)
downloadphp-git-8a7f7d5cae209c699f335a57d64c8dde8979392e.tar.gz
* pearweb xmlrpc layer now handles PEAR errors
Diffstat (limited to 'pear/PEAR/Remote.php')
-rw-r--r--pear/PEAR/Remote.php22
1 files changed, 21 insertions, 1 deletions
diff --git a/pear/PEAR/Remote.php b/pear/PEAR/Remote.php
index 17c36e023c..920c2d68aa 100644
--- a/pear/PEAR/Remote.php
+++ b/pear/PEAR/Remote.php
@@ -73,7 +73,27 @@ class PEAR_Remote extends PEAR
$response .= $chunk;
}
fclose($fp);
- return xmlrpc_decode($response);
+ $ret = xmlrpc_decode($response);
+ if (is_array($ret) && isset($ret['__PEAR_TYPE__'])) {
+ if ($ret['__PEAR_TYPE__'] == 'error') {
+ if (isset($ret['__PEAR_CLASS__'])) {
+ $class = $ret['__PEAR_CLASS__'];
+ } else {
+ $class = "PEAR_Error";
+ }
+ if ($ret['code'] === '') $ret['code'] = null;
+ if ($ret['message'] === '') $ret['message'] = null;
+ if ($ret['userinfo'] === '') $ret['userinfo'] = null;
+ if (strtolower($class) == 'db_error') {
+ return $this->raiseError(DB::errorMessage($ret['code']),
+ $ret['code'], null, null,
+ $ret['userinfo']);
+ } else {
+ return $this->raiseError($ret['message'], $ret['code'],
+ null, null, $ret['userinfo']);
+ }
+ }
+ }
}
// }}}