Skip to content

Commit

Permalink
Merge pull request #524 from emanuele45/error_backtrace
Browse files Browse the repository at this point in the history
That should allow to obtain more meaningful error messages...I hope
  • Loading branch information
norv committed Jun 15, 2013
2 parents 4d572b3 + 0efdf89 commit d3389b9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
8 changes: 7 additions & 1 deletion sources/database/Db-mysql.class.php
Expand Up @@ -775,7 +775,13 @@ function error_backtrace($error_message, $log_message = '', $error_type = false,
foreach (debug_backtrace() as $step)
{
// Found it?
if (strpos($step['function'], 'query') === false && !in_array(substr($step['function'], 0, 7), array('smf_db_', 'preg_re', 'db_erro', 'call_us')) && strpos($step['function'], '__') !== 0)
if (!method_exists($this, $step['function']))
{
$log_message .= '<br />Function: ' . $step['function'];
break;
}
// dunno if this is needed...if not feel free to remove it
elseif (strpos($step['function'], 'query') === false && !in_array(substr($step['function'], 0, 7), array('elk_db_', 'preg_re', 'db_erro', 'call_us')) && strpos($step['function'], '__') !== 0)
{
$log_message .= '<br />Function: ' . $step['function'];
break;
Expand Down
8 changes: 7 additions & 1 deletion sources/database/Db-postgresql.class.php
Expand Up @@ -834,7 +834,13 @@ function error_backtrace($error_message, $log_message = '', $error_type = false,
foreach (debug_backtrace() as $step)
{
// Found it?
if (strpos($step['function'], 'query') === false && !in_array(substr($step['function'], 0, 7), array('smf_db_', 'preg_re', 'db_erro', 'call_us')) && strpos($step['function'], '__') !== 0)
if (!method_exists($this, $step['function']))
{
$log_message .= '<br />Function: ' . $step['function'];
break;
}
// dunno if this is needed...if not feel free to remove it
elseif (strpos($step['function'], 'query') === false && !in_array(substr($step['function'], 0, 7), array('elk_db_', 'preg_re', 'db_erro', 'call_us')) && strpos($step['function'], '__') !== 0)
{
$log_message .= '<br />Function: ' . $step['function'];
break;
Expand Down
8 changes: 7 additions & 1 deletion sources/database/Db-sqlite.class.php
Expand Up @@ -693,7 +693,13 @@ function error_backtrace($error_message, $log_message = '', $error_type = false,
foreach (debug_backtrace() as $step)
{
// Found it?
if (strpos($step['function'], 'query') === false && !in_array(substr($step['function'], 0, 7), array('smf_db_', 'preg_re', 'db_erro', 'call_us')) && strpos($step['function'], '__') !== 0)
if (!method_exists($this, $step['function']))
{
$log_message .= '<br />Function: ' . $step['function'];
break;
}
// dunno if this is needed...if not feel free to remove it
elseif (strpos($step['function'], 'query') === false && !in_array(substr($step['function'], 0, 7), array('elk_db_', 'preg_re', 'db_erro', 'call_us')) && strpos($step['function'], '__') !== 0)
{
$log_message .= '<br />Function: ' . $step['function'];
break;
Expand Down

0 comments on commit d3389b9

Please sign in to comment.