mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 02:12:17 +00:00
RESTClient: get Error method works with string error messages
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user