From 6f414769f3e736672cd227f1b4ae924d09765f1a Mon Sep 17 00:00:00 2001 From: Christoph Potas Date: Mon, 20 Aug 2018 10:16:32 +0200 Subject: [PATCH 1/2] ~ pass through exception message Signed-off-by: Christoph Potas --- system/CodeIgniter.php | 2 +- system/Exceptions/PageNotFoundException.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/system/CodeIgniter.php b/system/CodeIgniter.php index cb03cedf5e79..38857fcd3e47 100644 --- a/system/CodeIgniter.php +++ b/system/CodeIgniter.php @@ -856,7 +856,7 @@ protected function display404errors(PageNotFoundException $e) } } - throw PageNotFoundException::forPageNotFound(); + throw PageNotFoundException::forPageNotFound( $e->getMessage() ); } //-------------------------------------------------------------------- diff --git a/system/Exceptions/PageNotFoundException.php b/system/Exceptions/PageNotFoundException.php index 8e6807f34174..a522509eefe7 100644 --- a/system/Exceptions/PageNotFoundException.php +++ b/system/Exceptions/PageNotFoundException.php @@ -8,9 +8,9 @@ class PageNotFoundException extends \OutOfBoundsException implements ExceptionIn */ protected $code = 404; - public static function forPageNotFound() + public static function forPageNotFound( $Message ) { - return new static(lang('HTTP.pageNotFound')); + return new static( $Message ?? lang('HTTP.pageNotFound')); } public static function forEmptyController() From 8037f3e93cde90e3dce83758bd88603ba7bce142 Mon Sep 17 00:00:00 2001 From: Christoph Potas Date: Mon, 20 Aug 2018 10:18:50 +0200 Subject: [PATCH 2/2] ~ apply ci style Signed-off-by: Christoph Potas --- system/CodeIgniter.php | 2 +- system/Exceptions/PageNotFoundException.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/system/CodeIgniter.php b/system/CodeIgniter.php index 38857fcd3e47..c19a27c186f8 100644 --- a/system/CodeIgniter.php +++ b/system/CodeIgniter.php @@ -856,7 +856,7 @@ protected function display404errors(PageNotFoundException $e) } } - throw PageNotFoundException::forPageNotFound( $e->getMessage() ); + throw PageNotFoundException::forPageNotFound($e->getMessage()); } //-------------------------------------------------------------------- diff --git a/system/Exceptions/PageNotFoundException.php b/system/Exceptions/PageNotFoundException.php index a522509eefe7..7bd3d58505b4 100644 --- a/system/Exceptions/PageNotFoundException.php +++ b/system/Exceptions/PageNotFoundException.php @@ -8,9 +8,9 @@ class PageNotFoundException extends \OutOfBoundsException implements ExceptionIn */ protected $code = 404; - public static function forPageNotFound( $Message ) + public static function forPageNotFound($Message) { - return new static( $Message ?? lang('HTTP.pageNotFound')); + return new static($Message ?? lang('HTTP.pageNotFound')); } public static function forEmptyController()