I’ve seen the code examples on this article, but throwing Controller_Exception_404 produces an error.
I’ve just been throwing plain exceptions. I remember in Kohana 2.3 there were different ones you could throw, depending on the situation.
Does anyone have a list of what exceptions should be thrown when?
I think the exception you want is
Kohana_Request_Exception. Here’s a list of all the exceptions Kohana defines (generated usinggrep -iR "class .*Exception" .):If you want a 404 response code, I think you’ll also have to do this in your controller
I don’t know what the “official” best practice is, but this is what I’ve found by playing around.