Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exploded the exception files in multiple class files. Now it lazy loa…
…d the classes
- Loading branch information
Showing
42 changed files
with
1,294 additions
and
575 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
/** | ||
* AclException class | ||
* | ||
* PHP 5 | ||
* | ||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | ||
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* @link http://book.cakephp.org/2.0/en/development/testing.html | ||
* @package Cake.Error | ||
* @since CakePHP(tm) v 3.0 | ||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | ||
*/ | ||
namespace Cake\Error; | ||
|
||
/** | ||
* Exception class for AclComponent and Interface implementations. | ||
* | ||
* @package Cake.Error | ||
*/ | ||
class AclException extends Exception { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
/** | ||
* BadRequestException class | ||
* | ||
* PHP 5 | ||
* | ||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | ||
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* @link http://book.cakephp.org/2.0/en/development/testing.html | ||
* @package Cake.Error | ||
* @since CakePHP(tm) v 3.0 | ||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | ||
*/ | ||
namespace Cake\Error; | ||
|
||
/** | ||
* Represents an HTTP 400 error. | ||
* | ||
* @package Cake.Error | ||
*/ | ||
class BadRequestException extends HttpException { | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param string $message If no message is given 'Bad Request' will be the message | ||
* @param string $code Status code, defaults to 400 | ||
*/ | ||
public function __construct($message = null, $code = 400) { | ||
if (empty($message)) { | ||
$message = 'Bad Request'; | ||
} | ||
parent::__construct($message, $code); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/** | ||
* CacheException class | ||
* | ||
* PHP 5 | ||
* | ||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | ||
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* @link http://book.cakephp.org/2.0/en/development/testing.html | ||
* @package Cake.Error | ||
* @since CakePHP(tm) v 3.0 | ||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | ||
*/ | ||
namespace Cake\Error; | ||
|
||
/** | ||
* Exception class for Cache. This exception will be thrown from Cache when it | ||
* encounters an error. | ||
* | ||
* @package Cake.Error | ||
*/ | ||
class CacheException extends Exception { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/** | ||
* ConfigureException class | ||
* | ||
* PHP 5 | ||
* | ||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | ||
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* @link http://book.cakephp.org/2.0/en/development/testing.html | ||
* @package Cake.Error | ||
* @since CakePHP(tm) v 3.0 | ||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | ||
*/ | ||
namespace Cake\Error; | ||
|
||
/** | ||
* Exception class for Configure. This exception will be thrown from Configure when it | ||
* encounters an error. | ||
* | ||
* @package Cake.Error | ||
*/ | ||
class ConfigureException extends Exception { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/** | ||
* ConsoleException class | ||
* | ||
* PHP 5 | ||
* | ||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | ||
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* @link http://book.cakephp.org/2.0/en/development/testing.html | ||
* @package Cake.Error | ||
* @since CakePHP(tm) v 3.0 | ||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | ||
*/ | ||
namespace Cake\Error; | ||
|
||
/** | ||
* Exception class for Console libraries. This exception will be thrown from Console library | ||
* classes when they encounter an error. | ||
* | ||
* @package Cake.Error | ||
*/ | ||
class ConsoleException extends Exception { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
/** | ||
* Exception class | ||
* | ||
* PHP 5 | ||
* | ||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | ||
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* @link http://book.cakephp.org/2.0/en/development/testing.html | ||
* @package Cake.Error | ||
* @since CakePHP(tm) v 3.0 | ||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | ||
*/ | ||
namespace Cake\Error; | ||
|
||
/** | ||
* Exception is used a base class for CakePHP's internal exceptions. | ||
* In general framework errors are interpreted as 500 code errors. | ||
* | ||
* @package Cake.Error | ||
*/ | ||
class Exception extends \RuntimeException { | ||
|
||
/** | ||
* Array of attributes that are passed in from the constructor, and | ||
* made available in the view when a development error is displayed. | ||
* | ||
* @var array | ||
*/ | ||
protected $_attributes = array(); | ||
|
||
/** | ||
* Template string that has attributes sprintf()'ed into it. | ||
* | ||
* @var string | ||
*/ | ||
protected $_messageTemplate = ''; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* Allows you to create exceptions that are treated as framework errors and disabled | ||
* when debug = 0. | ||
* | ||
* @param string|array $message Either the string of the error message, or an array of attributes | ||
* that are made available in the view, and sprintf()'d into Exception::$_messageTemplate | ||
* @param string $code The code of the error, is also the HTTP status code for the error. | ||
*/ | ||
public function __construct($message, $code = 500) { | ||
if (is_array($message)) { | ||
$this->_attributes = $message; | ||
$message = __d('cake_dev', $this->_messageTemplate, $message); | ||
} | ||
parent::__construct($message, $code); | ||
} | ||
|
||
/** | ||
* Get the passed in attributes | ||
* | ||
* @return array | ||
*/ | ||
public function getAttributes() { | ||
return $this->_attributes; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
/** | ||
* FatalErrorException class | ||
* | ||
* PHP 5 | ||
* | ||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | ||
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* @link http://book.cakephp.org/2.0/en/development/testing.html | ||
* @package Cake.Error | ||
* @since CakePHP(tm) v 3.0 | ||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | ||
*/ | ||
namespace Cake\Error; | ||
|
||
/** | ||
* Represents a fatal error | ||
* | ||
* @package Cake.Error | ||
*/ | ||
class FatalErrorException extends Exception { | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param string $message | ||
* @param integer $code | ||
* @param string $file | ||
* @param integer $line | ||
*/ | ||
public function __construct($message, $code = 500, $file = null, $line = null) { | ||
parent::__construct($message, $code); | ||
if ($file) { | ||
$this->file = $file; | ||
} | ||
if ($line) { | ||
$this->line = $line; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
/** | ||
* ForbiddenException class | ||
* | ||
* PHP 5 | ||
* | ||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | ||
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* @link http://book.cakephp.org/2.0/en/development/testing.html | ||
* @package Cake.Error | ||
* @since CakePHP(tm) v 3.0 | ||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | ||
*/ | ||
namespace Cake\Error; | ||
|
||
/** | ||
* Represents an HTTP 403 error. | ||
* | ||
* @package Cake.Error | ||
*/ | ||
class ForbiddenException extends HttpException { | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param string $message If no message is given 'Forbidden' will be the message | ||
* @param string $code Status code, defaults to 403 | ||
*/ | ||
public function __construct($message = null, $code = 403) { | ||
if (empty($message)) { | ||
$message = 'Forbidden'; | ||
} | ||
parent::__construct($message, $code); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
/** | ||
* HttpException class | ||
* | ||
* PHP 5 | ||
* | ||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | ||
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* @link http://book.cakephp.org/2.0/en/development/testing.html | ||
* @package Cake.Error | ||
* @since CakePHP(tm) v 3.0 | ||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | ||
*/ | ||
namespace Cake\Error; | ||
|
||
/** | ||
* 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.Error | ||
*/ | ||
class HttpException extends \RuntimeException { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
/** | ||
* InternalErrorException class | ||
* | ||
* PHP 5 | ||
* | ||
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | ||
* Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* @link http://book.cakephp.org/2.0/en/development/testing.html | ||
* @package Cake.Error | ||
* @since CakePHP(tm) v 3.0 | ||
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) | ||
*/ | ||
namespace Cake\Error; | ||
|
||
/** | ||
* Represents an HTTP 500 error. | ||
* | ||
* @package Cake.Error | ||
*/ | ||
class InternalErrorException extends HttpException { | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param string $message If no message is given 'Internal Server Error' will be the message | ||
* @param string $code Status code, defaults to 500 | ||
*/ | ||
public function __construct($message = null, $code = 500) { | ||
if (empty($message)) { | ||
$message = 'Internal Server Error'; | ||
} | ||
parent::__construct($message, $code); | ||
} | ||
|
||
} |
Oops, something went wrong.