chriso/klein.php — pull request #161 by Rican7 (2013-12-13 07:17:54+00:00)
Title: Feature - HTTP Error Handling

This PR introduces a [new feature][rfc-http-error-handling] while fixing a [known bug][issue-404-recognition].

The new feature is a more reliable and understandable way of HTTP error handling. It was implemented to satisfy the spec in the discussion made in the [RFC][rfc-http-error-handling]. Users of the library may now register HTTP error handlers much like they're used to with generic exceptions and can easily handle errors thrown anywhere in their applications.

Also, this PR introduces a new HttpException (and interface), for easily causing the HTTP error handler to be invoked while stopping the flow of the current controller.

Finally, a lot of behavioral tests were added since some of the bugs that this fixed weren't previously known.

I'm especially curious as to your thoughts, @chriso, @gbouthenot, and @drallen1.

[rfc-http-error-handling]: https://github.com/chriso/klein.php/issues/136
[issue-404-recognition]: https://github.com/chriso/klein.php/issues/132