[Corona] Catch exceptions in the FrontController

Review Request #554 — Created May 7, 2018 and submitted — Latest diff uploaded

pprkut
Lunr
pprkut:exceptions
576
df96749...
lunr

Catch exceptions in a RequestResultHandler class, which can be used by either a FrontController or a Controller class.
The RequestResultHandler sets the proper response codes, which should remove boiler plate code from Controllers.

Unit tests

Diff Revision 2

This is not the most recent revision of the diff. The latest diff is revision 4. See what's changed.

orig
1
2
3
4
src/Lunr/Corona/FrontController.php
src/Lunr/Corona/RequestResultHandler.php
src/Lunr/Corona/Exceptions/BadRequestException.php
src/Lunr/Corona/Exceptions/ForbiddenException.php
src/Lunr/Corona/Exceptions/HttpException.php
src/Lunr/Corona/Exceptions/MethodNotAllowedException.php
src/Lunr/Corona/Exceptions/NotFoundException.php
src/Lunr/Corona/Exceptions/NotImplementedException.php
src/Lunr/Corona/Exceptions/PreconditionFailedException.php
src/Lunr/Corona/Exceptions/RequestedRangeNotSatisfiableException.php
src/Lunr/Corona/Exceptions/UnauthorizedException.php
src/Lunr/Corona/Exceptions/Tests/BadRequestExceptionBaseTest.php
src/Lunr/Corona/Exceptions/Tests/ForbiddenExceptionBaseTest.php
src/Lunr/Corona/Exceptions/Tests/MethodNotAllowedExceptionBaseTest.php
src/Lunr/Corona/Exceptions/Tests/NotFoundExceptionBaseTest.php
src/Lunr/Corona/Exceptions/Tests/NotImplementedExceptionBaseTest.php
src/Lunr/Corona/Exceptions/Tests/PreconditionFailedExceptionBaseTest.php
src/Lunr/Corona/Exceptions/Tests/RequestedRangeNotSatisfiableExceptionBaseTest.php
src/Lunr/Corona/Exceptions/Tests/UnauthorizedExceptionBaseTest.php
src/Lunr/Corona/Exceptions/Tests/Helpers/HttpExceptionTest.php
src/Lunr/Corona/Tests/FrontControllerBaseTest.php
src/Lunr/Corona/Tests/FrontControllerDispatchTest.php
src/Lunr/Corona/Tests/FrontControllerTest.php
src/Lunr/Corona/Tests/RequestResultHandlerBaseTest.php
src/Lunr/Corona/Tests/RequestResultHandlerHandleRequestTest.php
src/Lunr/Corona/Tests/RequestResultHandlerSetResultTest.php
src/Lunr/Corona/Tests/RequestResultHandlerTest.php
tests/phpunit.xml
src/Lunr/Corona/FrontController.php
src/Lunr/Corona/RequestResultHandler.php
src/Lunr/Corona/Exceptions/BadRequestException.php
src/Lunr/Corona/Exceptions/ForbiddenException.php
src/Lunr/Corona/Exceptions/HttpException.php
src/Lunr/Corona/Exceptions/MethodNotAllowedException.php
src/Lunr/Corona/Exceptions/NotFoundException.php
src/Lunr/Corona/Exceptions/NotImplementedException.php
src/Lunr/Corona/Exceptions/PreconditionFailedException.php
src/Lunr/Corona/Exceptions/RequestedRangeNotSatisfiableException.php
src/Lunr/Corona/Exceptions/UnauthorizedException.php
src/Lunr/Corona/Exceptions/Tests/BadRequestExceptionBaseTest.php
src/Lunr/Corona/Exceptions/Tests/ForbiddenExceptionBaseTest.php
src/Lunr/Corona/Exceptions/Tests/MethodNotAllowedExceptionBaseTest.php
src/Lunr/Corona/Exceptions/Tests/NotFoundExceptionBaseTest.php
src/Lunr/Corona/Exceptions/Tests/NotImplementedExceptionBaseTest.php
src/Lunr/Corona/Exceptions/Tests/PreconditionFailedExceptionBaseTest.php
src/Lunr/Corona/Exceptions/Tests/RequestedRangeNotSatisfiableExceptionBaseTest.php
src/Lunr/Corona/Exceptions/Tests/UnauthorizedExceptionBaseTest.php
src/Lunr/Corona/Exceptions/Tests/Helpers/HttpExceptionTest.php
src/Lunr/Corona/Tests/FrontControllerBaseTest.php
src/Lunr/Corona/Tests/FrontControllerDispatchTest.php
src/Lunr/Corona/Tests/FrontControllerTest.php
src/Lunr/Corona/Tests/RequestResultHandlerBaseTest.php
src/Lunr/Corona/Tests/RequestResultHandlerHandleRequestTest.php
src/Lunr/Corona/Tests/RequestResultHandlerSetResultTest.php
src/Lunr/Corona/Tests/RequestResultHandlerTest.php
tests/phpunit.xml
Loading...