_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; } } /** * Missing Controller exception - used when a controller * cannot be found. * * @package Cake.Error */ class MissingControllerException extends CakeException { protected $_messageTemplate = 'Controller class %s could not be found.'; public function __construct($message, $code = 404) { parent::__construct($message, $code); } } /** * Missing Action exception - used when a controller action * cannot be found. * * @package Cake.Error */ class MissingActionException extends CakeException { protected $_messageTemplate = 'Action %s::%s() could not be found.'; public function __construct($message, $code = 404) { parent::__construct($message, $code); } } /** * Private Action exception - used when a controller action * starts with a `_`. * * @package Cake.Error */ class PrivateActionException extends CakeException { protected $_messageTemplate = 'Private Action %s::%s() is not directly accessible.'; public function __construct($message, $code = 404, Exception $previous = null) { parent::__construct($message, $code, $previous); } } /** * Used when a component cannot be found. * * @package Cake.Error */ class MissingComponentException extends CakeException { protected $_messageTemplate = 'Component class %s could not be found.'; } /** * Used when a behavior cannot be found. * * @package Cake.Error */ class MissingBehaviorException extends CakeException { protected $_messageTemplate = 'Behavior class %s could not be found.'; } /** * Used when a view file cannot be found. * * @package Cake.Error */ class MissingViewException extends CakeException { protected $_messageTemplate = 'View file "%s" is missing.'; } /** * Used when a layout file cannot be found. * * @package Cake.Error */ class MissingLayoutException extends CakeException { protected $_messageTemplate = 'Layout file "%s" is missing.'; } /** * Used when a helper cannot be found. * * @package Cake.Error */ class MissingHelperException extends CakeException { protected $_messageTemplate = 'Helper class %s could not be found.'; } /** * Runtime Exceptions for ConnectionManager * * @package Cake.Error */ class MissingDatabaseException extends CakeException { protected $_messageTemplate = 'Database connection "%s" could not be found.'; } /** * Used when no connections can be found. * * @package Cake.Error */ class MissingConnectionException extends CakeException { protected $_messageTemplate = 'Database connection "%s" is missing, or could not be created.'; public function __construct($message, $code = 500) { if (is_array($message)) { $message += array('enabled' => true); } parent::__construct($message, $code); } } /** * Used when a Task cannot be found. * * @package Cake.Error */ class MissingTaskException extends CakeException { protected $_messageTemplate = 'Task class %s could not be found.'; } /** * Used when a shell method cannot be found. * * @package Cake.Error */ class MissingShellMethodException extends CakeException { protected $_messageTemplate = "Unknown command %1\$s %2\$s.\nFor usage try `cake %1\$s --help`"; } /** * Used when a shell cannot be found. * * @package Cake.Error */ class MissingShellException extends CakeException { protected $_messageTemplate = 'Shell class %s could not be found.'; } /** * Exception class to be thrown when a datasource configuration is not found * * @package Cake.Error */ class MissingDatasourceConfigException extends CakeException { protected $_messageTemplate = 'The datasource configuration "%s" was not found in database.php'; } /** * Used when a datasource cannot be found. * * @package Cake.Error */ class MissingDatasourceException extends CakeException { protected $_messageTemplate = 'Datasource class %s could not be found.'; } /** * Exception class to be thrown when a database table is not found in the datasource * * @package Cake.Error */ class MissingTableException extends CakeException { protected $_messageTemplate = 'Table %s for model %s was not found in datasource %s.'; } /** * Exception raised when a Model could not be found. * * @package Cake.Error */ class MissingModelException extends CakeException { protected $_messageTemplate = 'Model %s could not be found.'; } /** * Exception raised when a test loader could not be found * * @package Cake.Error */ class MissingTestLoaderException extends CakeException { protected $_messageTemplate = 'Test loader %s could not be found.'; } /** * Exception raised when a plugin could not be found * * @package Cake.Error */ class MissingPluginException extends CakeException { protected $_messageTemplate = 'Plugin %s could not be found.'; } /** * Exception raised when a Dispatcher filter could not be found * * @package Cake.Error */ class MissingDispatcherFilterException extends CakeException { protected $_messageTemplate = 'Dispatcher filter %s could not be found.'; } /** * Exception class for AclComponent and Interface implementations. * * @package Cake.Error */ class AclException extends CakeException { } /** * Exception class for Cache. This exception will be thrown from Cache when it * encounters an error. * * @package Cake.Error */ class CacheException extends CakeException { } /** * Exception class for Router. This exception will be thrown from Router when it * encounters an error. * * @package Cake.Error */ class RouterException extends CakeException { } /** * Exception class for CakeLog. This exception will be thrown from CakeLog when it * encounters an error. * * @package Cake.Error */ class CakeLogException extends CakeException { } /** * Exception class for CakeSession. This exception will be thrown from CakeSession when it * encounters an error. * * @package Cake.Error */ class CakeSessionException extends CakeException { } /** * Exception class for Configure. This exception will be thrown from Configure when it * encounters an error. * * @package Cake.Error */ class ConfigureException extends CakeException { } /** * Exception class for Socket. This exception will be thrown from CakeSocket, CakeEmail, HttpSocket * SmtpTransport, MailTransport and HttpResponse when it encounters an error. * * @package Cake.Error */ class SocketException extends CakeException { } /** * Exception class for Xml. This exception will be thrown from Xml when it * encounters an error. * * @package Cake.Error */ class XmlException extends CakeException { } /** * 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 CakeException { } /** * Represents a fatal error * * @package Cake.Error */ class FatalErrorException extends CakeException { /** * 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; } } } /** * Not Implemented Exception - used when an API method is not implemented * * @package Cake.Error */ class NotImplementedException extends CakeException { protected $_messageTemplate = '%s is not implemented.'; public function __construct($message, $code = 501) { parent::__construct($message, $code); } }