Raise exceptions when json_encode fails
-
Adding my own extra information to the instructions and when a function is used generated an error. The message was generated by curl because a parameter was invalid. The reason is the $data parameter, which is the JSON encoding of the body, failed so was set to true.
It will be great if the validity of json encodings are checked and an exception with a suitable message based on the value of json_last_error_msg(). It will help user identify the cause of this particular error more quickly and without the need to debug though the plugin into curl request.
The topic ‘Raise exceptions when json_encode fails’ is closed to new replies.