From 375b24ab747705c5e4c19fa2e0f69bfe4bfe2ebe Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 11 May 2011 09:33:56 +0000 Subject: [PATCH] Added error handling to remote Object git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20801 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_remoteObject.inc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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. -- 2.30.2