phly / PhlyRestfully

ZF2 module for creating RESTful JSON APIs using HAL and API-Problem
108 stars 45 forks source link

Not all application exceptions are visible #74

Closed pietervogelaar closed 11 years ago

pietervogelaar commented 11 years ago

When developing a REST API, I started with adding Doctrine 2. My connection parameters where wrong which caused a PDOException in my onFetch method with status code 1045.

This exception is catched in the ResourceController.php and resulted in:

Fatal error: Uncaught exception 'Zend\Http\Exception\InvalidArgumentException' with message 'Invalid status code provided: "1045"' in ......./vendor/zendframework/zendframework/library/Zend/Http/Response.php on line 245

macnibblet commented 11 years ago

Yeah this has been discussed before, a REST Api should never return a status code higher then 599. Also those kinds of exceptions should be wrapped by your system before being published to a end user

weierophinney commented 11 years ago

This is actually fixed on current master, iirc...

On Monday, May 27, 2013, Antoine Hedgecock wrote:

Yeah this has been discussed before, a REST Api should never return a status code higher then 599. Also those kinds of exceptions should be wrapped by your system before being published to a end user

— Reply to this email directly or view it on GitHubhttps://github.com/weierophinney/PhlyRestfully/issues/74#issuecomment-18495032 .

Matthew Weier O'Phinney matthew@weierophinney.net http://mwop.net/

weierophinney commented 11 years ago

Fixed via 9859916 (attached to #68) last week.