This is created as a new Response object in the before() method, which runs before the router does. Or does your controller have a before(), and you didn't call parent::before() ?
Your error message mentions: COREPATH/classes/controller/rest.php @ line 157
So you're already either using Controller_Rest or Controller_Hybrid. For both, it is required that you call the controllers before method, otherwise your controller will not be setup properly.
I've look for extends Controller_Rest (or Controller_Hybrid), i call the before function. But same problem.
If the controller doesn't exist (ie. "test" on my first post), the class "Controller" throw a new HttpNotFoundException. It's ok.
But if the controller exist, but not the action, it's doesn't thrown a HttpNotFoundException. It's maybe because in the "Controller_Rest" class you do :
On an API call it shouldn't throw an HttpNotFoundException, the calling client wouldn't know what to do with it, it expects a REST response.
On a browser call, when you have extended Controller_Rest it should still return the "no-method" status (as it is designed for REST calls), but if you have extended Controller_Hybrid... Maybe in that case an HttpNotFoundException is in order.
Just checked the code, and it does. So it works as designed?
I've found the response of my problem, but i didn't know why it's an issue, i explain :
I have a base controller named "Controller_Base_Backend". And a module "backend", with a controller named "Controller_Backend" which extends \Controller_Base_Backend
If i go on "/backend/backend/index" it's ok. But if i go on "/backend/wrongcontroller/index" i've a blank page with no HttpNotFoundException.
But now, if i rename my controller with "Controller_Test" :
If i go on "/backend/test/index" it's ok. And if i go on "/backend/wrongcontroller/index" i've my 404 page.
Strange, no ?
Note: My \Controller_Base_Backend extends Controller_Hybrid
I've have see in \Router::parse_segments() the fallback for default module controller is [Module]/Controller_[Module], so in my case Backend\Controller_Backend.
In this case, if we have a controller with the same name of the module, FuelPHP can't throw an HttpNotFoundException if we are in the module URI ? (module name in the first segment)
If that is all you have, it will default to the index action, and if that exists, it should call it.
If you have a method (an additional URI segment), and that doesn't exist, either the controller's router method (<= 1.6.1) or the Request (1.7) should throw an HttpNotFoundException.
I can not reproduce that, when I take a stock 1.7 install, and try to access "/welcome/wrongaction", I get the 404 view (APPPATH/views/welcome/404.php) produced by the action_404...
Your example can also never work, because "/test" would resolve to action_index(), and you're test controller doesn't have that.
Yes sorry for my mistake, replace "action_test()" with "action_index()" in my controller. I've the same issue on 1.6 install. On 1.7/develop it's work fine.