{"id":1526,"date":"2022-08-30T15:17:16","date_gmt":"2022-08-30T15:17:16","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/26\/catching-unhandled-request-in-kohana-3-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:17:16","modified_gmt":"2022-08-30T15:17:16","slug":"catching-unhandled-request-in-kohana-3-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/catching-unhandled-request-in-kohana-3-collection-of-common-programming-errors\/","title":{"rendered":"Catching unhandled request in Kohana 3-Collection of common programming errors"},"content":{"rendered":"<p>I have done this simple catch:<\/p>\n<pre><code>try\n{\n    echo Request::factory()\n        -&gt;execute()\n        -&gt;send_headers()\n        -&gt;body();\n}catch(Exception $e)\n{\n    echo 'You tried to reach: ?';\n}\n<\/code><\/pre>\n<p>in the bottom of my bootstrap.php and removed<\/p>\n<p>echo Request::factory() -&gt;execute() -&gt;send_headers() -&gt;body();<\/p>\n<p>From the root index.php. This works fine, and the output &#8220;You tried to reach ?&#8221; appears when there&#8217;s a request of something unhandled.<\/p>\n<p>I wish to mention the URI in this output message.<\/p>\n<p>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.<\/p>\n<p>How can i do this?<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-26 18:03:57. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I have done this simple catch: try { echo Request::factory() -&gt;execute() -&gt;send_headers() -&gt;body(); }catch(Exception $e) { echo &#8216;You tried to reach: ?&#8217;; } in the bottom of my bootstrap.php and removed echo Request::factory() -&gt;execute() -&gt;send_headers() -&gt;body(); From the root index.php. This works fine, and the output &#8220;You tried to reach ?&#8221; appears when there&#8217;s a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1526","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1526","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1526"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1526\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1526"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}