Looking to extract the error message from _body.
My current method involves:
console.log(message._body.error);
Unfortunately, this returns undefined.
If I try console.log(message._body);
I receive "{"code":141,"error":"This phone number exists already!"}"
var message = {
"_body":"{"code":141,"error":"This phone number exists already!}",
"status":400,
"ok":false,
"statusText":"Bad Request",
"type":2
};
Note: The backend provides the following format and it cannot be altered or quotes removed
"_body":"{"code":141,"error":"This phone number exists already!"}"
Any suggestions on how to access the error message?