jmathai / epiphany

A micro PHP framework that's fast, easy, clean and RESTful. The framework does not do a lot of magic under the hood. It is, by design, very simple and very powerful.
https://github.com/jmathai/epiphany
Other
686 stars 139 forks source link

Added handling of JSON errors for postprocessing #89

Open BenWoodford opened 10 years ago

BenWoodford commented 10 years ago

The odd UTF8 error or otherwise can cause nothing to output and you have no idea what the error could be. This outputs an error message if the framework failed to encode the json response successfully.

A fallback is also provided for pre-PHP5.5.0 support, as json_last_error_msg() is only in >=5.5