Retrofitted three changes from trunk, for the REST/JSON API:

- Enum should be output as the raw value (not the translated label)
- #877 Improved the update of case logs
- #891 Better error reporting when authentication parameters are missing

SVN:2.0.2[3091]
This commit is contained in:
Romain Quetiez
2014-02-27 10:42:02 +00:00
parent 945b9dc8a9
commit ead3a552e7
4 changed files with 152 additions and 10 deletions

View File

@@ -580,6 +580,14 @@ class RestResult
* Result: the input structure is not a valid JSON string
*/
const INVALID_JSON = 4;
/**
* Result: the parameter 'auth_user' is missing, authentication aborted
*/
const MISSING_AUTH_USER = 5;
/**
* Result: the parameter 'auth_pwd' is missing, authentication aborted
*/
const MISSING_AUTH_PWD = 6;
/**
* Result: no operation is available for the specified version
*/
@@ -944,7 +952,14 @@ class RestUtils
foreach ($aFields as $sAttCode => $value)
{
$realValue = self::MakeValue($sClass, $sAttCode, $value);
$oObject->Set($sAttCode, $realValue);
try
{
$oObject->Set($sAttCode, $realValue);
}
catch (Exception $e)
{
throw new Exception("$sAttCode: ".$e->getMessage(), $e->getCode());
}
}
return $oObject;
}
@@ -964,7 +979,14 @@ class RestUtils
foreach ($aFields as $sAttCode => $value)
{
$realValue = self::MakeValue($sClass, $sAttCode, $value);
$oObject->Set($sAttCode, $realValue);
try
{
$oObject->Set($sAttCode, $realValue);
}
catch (Exception $e)
{
throw new Exception("$sAttCode: ".$e->getMessage(), $e->getCode());
}
}
return $oObject;
}