When I change setting at config.php 'csrf_bad_request_on_fail' is false, view/400.php is shown.
But FuelPHP use only view/400.php, I mean controller/error/action_400 doesn't work, because error page doesn't contain template.php which is added at controller_template.
I think this means error-catching at index.php doesn't work in this case. Because at index.php FuelPHP will
use config/routes.php setting and routes.php will use controller/error/action_400.
In this case, not index.php but other source code catches SecurityException and use a default error page.
And if 'csrf_bad_request_on_fail' is true, it use only view file(view/400.php) to show an error page.
if "csrf_bad_request_on_fail" is true, a HttpBadRequestException is thrown, and with false, a SecurityException is thrown. So it should be set to false. If you set it to true, you can't catch SecurityException, as it isn't thrown at all.
I used the route
'_400_' => 'welcome/400', // The main 400 route
and added the method mentioned in my previous post to the welcome controller (I test on new fuel installs, so no other controllers present), and that works fine.
There was a bug in index.php that I found while testing, but that was concerning URI's for which no route was defined, like
$routerequest('some/other/route', $e);
which I fixed in 1.9/develop, but that isn't the case for you.
Basically my "csrf_bad_request_on_fail" is false. I just tried to check that when it is false,
index.php can catch HttpBadRequestException. It works partially, it show only view without controller action. And when it turns true, I assumed \SecurityException should be catched. But so far, \SecurityException is not catched. It shows a default error message not my view.
As I showed at the first post, my route.php is same like you. And this time, I changed controller/error.php like following:
public function action_400(){ //400 Bad Request
return Response::forge(View::forge('400'), 400);
}
But result was same. I mean a default error message page appears.