Fix: add getApiError() method

This commit is contained in:
Regis Houssin 2012-03-12 17:13:54 +01:00
parent dec582843b
commit 640f2e4c22

View File

@ -763,4 +763,26 @@ function deformatNVP($nvpstr)
return $nvpArray;
}
/**
* Get API errors
*/
function getApiError()
{
$errors=array();
$resArray=$_SESSION['reshash'];
if(isset($_SESSION['curl_error_no']))
{
$errors[] = $_SESSION['curl_error_no'].'-'.$_SESSION['curl_error_msg'];
}
foreach($resArray as $key => $value)
{
$errors[] = $key.'-'.$value;
}
return $errors;
}
?>