I think the exception you want is Kohana_Request_Exception
. Here's a list of all the exceptions Kohana defines (generated using grep -iR "class .*Exception" .
):
class Validate_Exception extends Kohana_Validate_Exception {}
class Kohana_Validate_Exception extends Kohana_Exception {
class Kohana_Request_Exception extends Kohana_Exception { }
class Kohana_Exception extends Exception {
class Kohana_View_Exception extends Kohana_Exception { }
If you want a 404 response code, I think you'll also have to do this in your controller
$this->request->status = 404;
I don't know what the "official" best practice is, but this is what I've found by playing around.