on PHP 5.5, you could use ``json_last_error_msg`` to get the message for the last error.

and the method should be private