summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 296e7ed)
raw | patch | inline | side by side (parent: 296e7ed)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 27 Feb 2008 10:39:36 +0000 (10:39 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 27 Feb 2008 10:39:36 +0000 (10:39 +0000) |
-Updated error handling
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9161 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9161 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_gosaSupportDaemon.inc | patch | blob | history |
diff --git a/gosa-core/include/class_gosaSupportDaemon.inc b/gosa-core/include/class_gosaSupportDaemon.inc
index 1cb7a819072fc2dcf4de7c175e055f889d6c2544..4c4ddcde04484e9801f0f0760852fc38ac23fc76 100644 (file)
$this->o_sock->setEncryptionKey($this->s_encryption_key);
$this->is_connected = TRUE;
}else{
- $this->s_error = $this->o_sock->get_error();
- $this->b_error = TRUE;
+ $this->set_error($this->o_sock->get_error());
$this->disconnect();
}
return($this->is_connected);
}
+ /*! \brief Sets an error message, which can be returned with get_error().
+ @param string The Error message,
+ */
+ private function reset_error()
+ {
+ $this->b_error = FALSE;
+ $this->s_error = "";
+ }
+
+
/*! \brief Checks if an error occured.
@return boolean returns TRUE or FALSE, whether there is an error or not.
*/
*/
public function get_error()
{
- return($this->s_error);
+ $str = $this->s_error;
+ $str = preg_replace("/ /"," ",$str);
+ return($str);
}
*/
public function get_queued_entries($from=-1,$to=-1,$sort="timestamp DESC")
{
- $this->b_error = FALSE;
- $this->s_error = "";
+ $this->reset_error();
$ret = array();
$xml_msg = "<xml>
trigger_error("Requires an array as parameter.");
return;
}
- $this->b_error = FALSE;
- $this->s_error = "";
+ $this->reset_error();
$ret = array();
trigger_error("Requires an array as parameter.");
return;
}
- $this->b_error = FALSE;
- $this->s_error = "";
+ $this->reset_error();
$ret = array();
return;
}
- $this->b_error = FALSE;
- $this->s_error = "";
+ $this->reset_error();
+
$xml_msg = "<xml>
<header>gosa_query_jobdb</header>
<target>GOSA</target>
trigger_error("Requires an integer as parameter.");
return;
}
+ $this->reset_error();
- $this->b_error = FALSE;
- $this->s_error = "";
$ret = array();
$xml_msg = "<xml>
<header>gosa_query_jobdb</header>
trigger_error("Requires an array as parameter.");
return;
}
- $this->b_error = FALSE;
- $this->s_error = "";
+
+ $this->reset_error();
$ret = array();
$xml_msg .= "</clause>
</where>
</xml>";
- $this->b_error = FALSE;
- $this->s_error = "";
if($this->connect()){
$this->o_sock->write($xml_msg);
*/
public function remove_entry($id)
{
- $this->b_error = FALSE;
- $this->s_error = "";
+ $this->reset_error();
$xml_msg = "<xml>
<header>gosa_delete_jobdb_entry</header>
*/
public function update_entries($ids,$entry)
{
- $this->b_error = FALSE;
- $this->s_error = "";
+ $this->reset_error();
if(!is_array($ids)){
trigger_error("Requires an array as first parameter.");
return;
*/
public function _send($data, $answer_expected= FALSE)
{
- $this->b_error = FALSE;
- $this->s_error = "";
+ $this->reset_error();
$ret = array();
if($this->connect()){
$this->o_sock->write($data);
+
if ($answer_expected){
$str = trim($this->o_sock->read());
$entries = $this->xml_to_array($str);