{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/21611","repository_url":"https://api.github.com/repos/joomla/joomla-cms","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/21611/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/21611/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/21611/events","html_url":"https://github.com/joomla/joomla-cms/issues/21611","id":350406453,"node_id":"MDU6SXNzdWUzNTA0MDY0NTM=","number":21611,"title":"[4.0] No Backtrace with $db->setQuery( $query );","user":{"login":"PhocaCz","id":5381559,"node_id":"MDQ6VXNlcjUzODE1NTk=","avatar_url":"https://avatars1.githubusercontent.com/u/5381559?v=4","gravatar_id":"","url":"https://api.github.com/users/PhocaCz","html_url":"https://github.com/PhocaCz","followers_url":"https://api.github.com/users/PhocaCz/followers","following_url":"https://api.github.com/users/PhocaCz/following{/other_user}","gists_url":"https://api.github.com/users/PhocaCz/gists{/gist_id}","starred_url":"https://api.github.com/users/PhocaCz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhocaCz/subscriptions","organizations_url":"https://api.github.com/users/PhocaCz/orgs","repos_url":"https://api.github.com/users/PhocaCz/repos","events_url":"https://api.github.com/users/PhocaCz/events{/privacy}","received_events_url":"https://api.github.com/users/PhocaCz/received_events","type":"User","site_admin":false},"labels":[{"id":138443932,"node_id":"MDU6TGFiZWwxMzg0NDM5MzI=","url":"https://api.github.com/repos/joomla/joomla-cms/labels/No%20Code%20Attached%20Yet","name":"No Code Attached Yet","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-14T12:28:06Z","updated_at":"2018-08-15T12:13:40Z","closed_at":null,"author_association":"NONE","body":"Hi, \r\nrather a question than a bug report.\r\n\r\nIn Joomla! 3.8, when the SQL query includes error:\r\n\r\n```\r\n$db = JFactory::getDBO();\r\n$query = 'SELECT ... error in SQL ...';\r\n$db->setQuery( $query );\r\n```\r\n\r\nthen Joomla! returns error including backtrace\r\n\r\n```\r\nlibraries\\joomla\\database\\driver\\mysqli.php LINE 650:\r\nthrow new JDatabaseExceptionExecuting($query, $this->errorMsg, $this->errorNum);\r\n```\r\n\r\nBut in Joomla! 4, the error is returned without backtrace, without definition of file or row\r\n\r\n```\r\nlibraries\\vendor\\joomla\\database\\src\\Mysqli\\MysqliStatement.php LINE 136:\r\nthrow new PrepareStatementFailureException($this->connection->error, $this->connection->errno);\r\n```\r\n\r\n\r\n### Steps to reproduce the issue\r\n- Ask some data from database\r\n- Not inside a model\r\n- Make an error in the SQL (for example ask non existing table)\r\n- Enable debug mode so backtrace is listed\r\n\r\n```\r\n$db = JFactory::getDBO();\r\n$query = 'SELECT ...';\r\n$db->setQuery( $query );\r\n```\r\n\r\n\r\n### Expected result\r\nIn Joomla! 3.8 - backtrace is displayed\r\n\r\n\r\n\r\n### Actual result\r\nIn Joomla! 4 - backtrace is not displayed (no file or row definition)\r\n\r\n\r\n### System information (as much as possible)\r\nJoomla! 4, PHP 7.2.4, 10.2.6-MariaDB\r\n"},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/413179708","html_url":"https://github.com/joomla/joomla-cms/issues/21611#issuecomment-413179708","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/21611","id":413179708,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMzE3OTcwOA==","user":{"login":"mbabker","id":368545,"node_id":"MDQ6VXNlcjM2ODU0NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/368545?v=4","gravatar_id":"","url":"https://api.github.com/users/mbabker","html_url":"https://github.com/mbabker","followers_url":"https://api.github.com/users/mbabker/followers","following_url":"https://api.github.com/users/mbabker/following{/other_user}","gists_url":"https://api.github.com/users/mbabker/gists{/gist_id}","starred_url":"https://api.github.com/users/mbabker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbabker/subscriptions","organizations_url":"https://api.github.com/users/mbabker/orgs","repos_url":"https://api.github.com/users/mbabker/repos","events_url":"https://api.github.com/users/mbabker/events{/privacy}","received_events_url":"https://api.github.com/users/mbabker/received_events","type":"User","site_admin":false},"created_at":"2018-08-15T12:13:40Z","updated_at":"2018-08-15T12:13:40Z","author_association":"MEMBER","body":"3.8 should not have uncaught exceptions printing like that and the fact you have that screen print to mean indicates that something is turning off core's error handler.  Both 3.8 and 4.0 should look like your second screenshot, but only when there is an error rendering the error page document (which, your query would do)."}}
{"actor":{"display_login":"mbabker"}}