apinstein / phocoa

PHOCOA php framework
http://phocoa.com
15 stars 3 forks source link

Implement canonical YOU SCREWED UP / SERVER SCREWED UP exceptions #22

Open apinstein opened 13 years ago

apinstein commented 13 years ago

Instead of documenting to throw WFException everywhere (which ends up as a 500), use:

WFRequestController_ServerException => 500 WFRequestController_UserException => 400

Based on idea from http://broadcast.oreilly.com/2011/06/the-good-the-bad-the-ugly-of-rest-apis.html

Failing to realize that a 4xx error means I messed up and a 5xx means you messed up