-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
bugVerified issues on the current code behavior or pull requests that will fix themVerified issues on the current code behavior or pull requests that will fix them
Description
This is PoC to show the current PageNotFoundException handling is not good.
.env:
CI_ENVIRONMENT = production
--- a/app/Config/Events.php
+++ b/app/Config/Events.php
@@ -4,6 +4,7 @@ namespace Config;
use CodeIgniter\Events\Events;
use CodeIgniter\Exceptions\FrameworkException;
+use CodeIgniter\Exceptions\PageNotFoundException;
/*
* --------------------------------------------------------------------
@@ -46,3 +47,7 @@ Events::on('pre_system', static function () {
Services::toolbar()->respond();
}
});
+
+Events::on('pre_system', static function () {
+ throw new PageNotFoundException('this is raw exception message.');
+});Navigate to http://localhost:8080/ and you will see:
404 - File Not Found
this is raw exception message.
Metadata
Metadata
Assignees
Labels
bugVerified issues on the current code behavior or pull requests that will fix themVerified issues on the current code behavior or pull requests that will fix them