Created
April 20, 2016 18:52
-
-
Save jonathonbyrdziak/16d9e112d865913f393f9d081764bb7c to your computer and use it in GitHub Desktop.
enhance the Magento sql debugging.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // <-- this line is just to color the code for you. Do not include it | |
// comment out the current exception throw. | |
//throw new Zend_Db_Statement_Exception($e->getMessage(), (int) $e->getCode(), $e); | |
// Modified the next line and added the subequent lines to show the full SQL query and params: | |
$msg = "SQL ERROR: ". $e->getMessage() . "\n"; | |
$msg .= "SQL QUERY: <span style='color: maroon;'>" . $this->_stmt->queryString."</span>\n"; | |
if(!empty($params)) { | |
$msg .= "SQL PARAMS: ('". implode("','", $params) ."')\n"; | |
} | |
$dbsEx = new Zend_Db_Statement_Exception($msg, (int) $e->getCode(), $e); | |
throw $dbsEx; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment