Catching unhandled request in Kohana 3-Collection of common programming errors

I have done this simple catch:

try
{
    echo Request::factory()
        ->execute()
        ->send_headers()
        ->body();
}catch(Exception $e)
{
    echo 'You tried to reach: ?';
}

in the bottom of my bootstrap.php and removed

echo Request::factory() ->execute() ->send_headers() ->body();

From the root index.php. This works fine, and the output “You tried to reach ?” appears when there’s a request of something unhandled.

I wish to mention the URI in this output message.

My further plans are to check in the DB for URI that matches the unhandled request, so for now I need to grab the URI you have tried to access.

How can i do this?

Originally posted 2013-11-26 18:03:57.