{"id":4762,"date":"2025-03-12T17:11:52","date_gmt":"2025-03-12T17:11:52","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=4762"},"modified":"2026-02-26T11:25:50","modified_gmt":"2026-02-26T11:25:50","slug":"throw-an-exception","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/php\/errors\/throw-an-exception","title":{"rendered":"Throw an exception"},"content":{"rendered":"\n<p>Using this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>throw new Exception(\"Invalid access token provided\");\n\nUse this inside a namespace:\nthrow new \\Exception(\"Invalid access token provided\");<\/code><\/pre>\n\n\n\n<p>Will give you this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Fatal error: Uncaught Exception: Invalid access token provided in \/var\/www\/vhosts\/.......... on line 91<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Using this: Will give you this:<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[],"class_list":["post-4762","post","type-post","status-publish","format-standard","hentry","category-errors"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/4762","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=4762"}],"version-history":[{"count":2,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/4762\/revisions"}],"predecessor-version":[{"id":5298,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/4762\/revisions\/5298"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=4762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=4762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=4762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}