Skip to content

Exception message JSON string is double quoted #15

@morsecoding

Description

@morsecoding

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\"]}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions