summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-03-06 05:23:33 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-03-06 05:23:33 +0000
commiteb9aae6f5f498c70d4879249dcd5537899b7661c (patch)
treeed2b23adb0e1e44b0f90572c4b6bd9a5a52e5765 /etc
parent5f2ad49702d5625434eb3b6b14ecc88a8a2da831 (diff)
downloadpfsense-eb9aae6f5f498c70d4879249dcd5537899b7661c.zip
pfsense-eb9aae6f5f498c70d4879249dcd5537899b7661c.tar.gz
MFC 10300
Handle both communication and XMLRPC related errors. Ticket #855
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/pfsense-utils.inc10
1 files changed, 7 insertions, 3 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 9ef427b..0c48bc8 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -1173,11 +1173,15 @@ function call_pfsense_method($method, $params, $timeout = 0) {
$msg = new XML_RPC_Message($method, array(XML_RPC_Encode($params)));
$cli = new XML_RPC_Client($xmlrpc_path, $xmlrpc_base_url);
$resp = $cli->send($msg, $timeout);
- if(!$resp or $resp->faultCode()) {
+ if(!$resp) {
+ log_error("XMLRPC communication error: " . $cli->errstr);
+ return false;
+ } elseif($resp->faultCode()) {
log_error("XMLRPC request failed with error " . $resp->faultCode() . ": " . $resp->faultString());
return false;
+ } else {
+ return XML_RPC_Decode($resp->value());
}
- return XML_RPC_Decode($resp->value());
}
/*
@@ -1710,4 +1714,4 @@ function print_value_list($list, $count = 10, $separator = ",") {
return $list;
}
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud