From b00d02496e9ec8281a6e0d6637772c55a7011c60 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Sat, 22 Nov 2014 23:10:19 +0100 Subject: [ticket/13361] Improve the exception listener PHPBB3-13361 --- phpBB/phpbb/exception/exception.php | 52 +++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 phpBB/phpbb/exception/exception.php (limited to 'phpBB/phpbb/exception/exception.php') diff --git a/phpBB/phpbb/exception/exception.php b/phpBB/phpbb/exception/exception.php new file mode 100644 index 0000000000..077d0d258a --- /dev/null +++ b/phpBB/phpbb/exception/exception.php @@ -0,0 +1,52 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\exception; + +/** + * Class exception + * + * Define an exception which support a language var as message. + */ +class exception extends \RuntimeException implements exception_interface +{ + /** + * Parameters to use with the language var. + * + * @var array + */ + private $parameters; + + /** + * Constructor + * + * @param string $message The Exception message to throw (must be a language variable). + * @param array $parameters The parameters to use with the language var. + * @param \Exception $previous The previous exception used for the exception chaining. + * @param integer $code The Exception code. + */ + public function __construct($message = "", array $parameters = array(), \Exception $previous = null, $code = 0) + { + $this->parameters = $parameters; + + parent::__construct($message, $code, $previous); + } + + /** + * {@inheritdoc} + */ + public function get_parameters() + { + return $this->parameters; + } +} -- cgit v1.2.1