mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Adding a base HttpException for all the various HttpExceptions that cake provides, this should make it easier to write concise catch blocks.
This commit is contained in:
parent
60ada4432a
commit
6c0efb62e7
1 changed files with 15 additions and 6 deletions
|
@ -19,12 +19,21 @@
|
|||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
|
||||
*/
|
||||
|
||||
/**
|
||||
* Parent class for all of the HTTP related exceptions in CakePHP.
|
||||
* All HTTP status/error related exceptions should extend this class so
|
||||
* catch blocks can be specifically typed.
|
||||
*
|
||||
* @package cake.libs
|
||||
*/
|
||||
class HttpException extends RuntimeException { }
|
||||
|
||||
/**
|
||||
* Represents an HTTP 400 error.
|
||||
*
|
||||
* @package cake.libs
|
||||
*/
|
||||
class BadRequestException extends RuntimeException {
|
||||
class BadRequestException extends HttpException {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
@ -44,7 +53,7 @@ class BadRequestException extends RuntimeException {
|
|||
*
|
||||
* @package cake.libs
|
||||
*/
|
||||
class UnauthorizedException extends RuntimeException {
|
||||
class UnauthorizedException extends HttpException {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
@ -64,7 +73,7 @@ class UnauthorizedException extends RuntimeException {
|
|||
*
|
||||
* @package cake.libs
|
||||
*/
|
||||
class ForbiddenException extends RuntimeException {
|
||||
class ForbiddenException extends HttpException {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
@ -84,7 +93,7 @@ class ForbiddenException extends RuntimeException {
|
|||
*
|
||||
* @package cake.libs
|
||||
*/
|
||||
class NotFoundException extends RuntimeException {
|
||||
class NotFoundException extends HttpException {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
@ -104,7 +113,7 @@ class NotFoundException extends RuntimeException {
|
|||
*
|
||||
* @package cake.libs
|
||||
*/
|
||||
class MethodNotAllowedException extends RuntimeException {
|
||||
class MethodNotAllowedException extends HttpException {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
@ -124,7 +133,7 @@ class MethodNotAllowedException extends RuntimeException {
|
|||
*
|
||||
* @package cake.libs
|
||||
*/
|
||||
class InternalErrorException extends CakeException {
|
||||
class InternalErrorException extends HttpException {
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue