Skip to content

Commit

Permalink
Merge pull request #1168 from puschie286/showExceptionMessage
Browse files Browse the repository at this point in the history
show PageNotFoundException message
  • Loading branch information
lonnieezell committed Aug 20, 2018
2 parents c1bc16b + 8037f3e commit c30aa20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion system/CodeIgniter.php
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ protected function display404errors(PageNotFoundException $e)
}
}

throw PageNotFoundException::forPageNotFound();
throw PageNotFoundException::forPageNotFound($e->getMessage());
}

//--------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions system/Exceptions/PageNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit c30aa20

Please sign in to comment.