Compare commits

...

1 Commits

Author SHA1 Message Date
KarpAlex 02c16ca8d9 RESTClient: get Error method works with string error messages 2023-12-28 15:20:42 +01:00
+3 -4
View File
@@ -120,10 +120,9 @@ export const CoreRESTClient = {
* Retrives error message from response object
*/
getError: function(response) {
if (typeof response[CORE_REST_CLIENT_RETVAL] === "object"
&& Object.keys(response[CORE_REST_CLIENT_RETVAL]).length > 0
&& response.hasOwnProperty(CORE_REST_CLIENT_RETVAL))
if (response.hasOwnProperty(CORE_REST_CLIENT_RETVAL)
&& ((typeof response[CORE_REST_CLIENT_RETVAL] === "object" && Object.keys(response[CORE_REST_CLIENT_RETVAL]).length > 0)
|| (typeof response[CORE_REST_CLIENT_RETVAL] === "string" && response[CORE_REST_CLIENT_RETVAL].trim() != "")))
{
return response[CORE_REST_CLIENT_RETVAL];
}