summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a054e77)
raw | patch | inline | side by side (parent: a054e77)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 19 Apr 2011 09:52:41 +0000 (09:52 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 19 Apr 2011 09:52:41 +0000 (09:52 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20743 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_jsonRPC.inc | patch | blob | history |
index 443d23e195daadbd25669d977bbd2b766cc2fd0d..a3a164e8354119e84faa1572b1d46e0fbb9a3d10 100644 (file)
*/
public function get_error()
{
+ $error = "";
if($this->lastStats['http_code'] != 200){
$error = $this->getHttpStatusCodeMessage($this->lastStats['http_code']);
- if(isset($this->lastResult['error']['error']) && is_array($this->lastResult['error']['error'])){
- $err = $this->lastResult['error']['error'];
- $message = call_user_func_array(sprintf,$err);
- $error .= $message;
- }elseif(isset($this->lastResult['error']['message'])){
- $error .= ": ".$this->lastResult['error']['message'];
- }
- return($error);
- }else{
- return(curl_error($this->curlHandler));
}
+ if(isset($this->lastResult['error']['error']) && is_array($this->lastResult['error']['error'])){
+ $err = $this->lastResult['error']['error'];
+ $message = call_user_func_array(sprintf,$err);
+ $error .= $message;
+ }elseif(isset($this->lastResult['error']['message'])){
+ $error .= $this->lastResult['error']['message'];
+ }
+ if($error){
+ return(trim($error, ": "));
+ }
+ return(curl_error($this->curlHandler));
}
-
/*! \brief Returns TRUE if the last action was successfull else FALSE.
public function success()
{
return(curl_errno($this->curlHandler) == 0 &&
+ !isset($this->lastResult['error']) &&
isset($this->lastStats['http_code']) &&
$this->lastStats['http_code'] == 200);
}