From: hickert Date: Wed, 11 May 2011 09:33:56 +0000 (+0000) Subject: Added error handling to remote Object X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=375b24ab747705c5e4c19fa2e0f69bfe4bfe2ebe;p=gosa.git Added error handling to remote Object git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20801 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_remoteObject.inc b/gosa-core/include/class_remoteObject.inc index 224081a45..c3e241f08 100644 --- a/gosa-core/include/class_remoteObject.inc +++ b/gosa-core/include/class_remoteObject.inc @@ -15,6 +15,8 @@ class remoteObject private $object_id; private $ref_id; private $values; + private $success; + private $lastError; private $cache = array(); @@ -116,6 +118,8 @@ class remoteObject // Forward to the call to the backend. if(in_array($name, $this->methods)){ + $this->lastError = ""; + $this->success = TRUE; $fArgs = array(); $fArgs[] = $this->ref_id; $fArgs[] = $name; @@ -123,7 +127,9 @@ class remoteObject $res = call_user_func_array(array($this->rpcHandle,"dispatchObjectMethod"), $fArgs); if(!$this->rpcHandle->success()){ - trigger_error($this->rpcHandle->get_error()); + $this->success = FALSE; + $this->lastError = $this->rpcHandle->get_error(); + trigger_error($this->lastError); } return($res); @@ -134,6 +140,12 @@ class remoteObject } + function success() + { + return($this->success); + } + + /*!\brief A catch all method for setter calls. * * @param String The name of the property to set.