When using try block to catch SHIPPINGEASY_INVALIDREQUESTERROR when creating a new order, using getMessage() returns a JSON string inside double quotes. This makes it impossible to json_decode without using something like str_replace() to get rid of the beginning and ending quotes.
var_dump($theException);
// result
...
["message":protected]=>string(81) ""{\"external_order_identifier\":[\"order already exists with that identifier\"]}""
...
echo $theException->getMessage();
// result
"{\"external_order_identifier\":[\"order already exists with that identifier\"]}"
When using try block to catch SHIPPINGEASY_INVALIDREQUESTERROR when creating a new order, using getMessage() returns a JSON string inside double quotes. This makes it impossible to json_decode without using something like str_replace() to get rid of the beginning and ending quotes.