mirror of
https://github.com/dg/dibi.git
synced 2025-08-13 17:44:11 +02:00
bugfix, enhanced error reporting, better examples
This commit is contained in:
@@ -123,13 +123,14 @@ abstract class DibiDriver
|
||||
dibi::log(
|
||||
"ERROR: $info[message]"
|
||||
. "\n-- SQL: " . $sql
|
||||
. "\n-- driver: " . $this->config['driver']
|
||||
. ";\n-- " . date('Y-m-d H:i:s ')
|
||||
);
|
||||
}
|
||||
|
||||
if (dibi::$throwExceptions) {
|
||||
$info = $this->errorInfo();
|
||||
throw new DibiException('Query error', $info, $sql);
|
||||
throw new DibiException('Query error (driver ' . $this->config['driver'] . ')', $info, $sql);
|
||||
} else {
|
||||
$info = $this->errorInfo();
|
||||
if ($info['code']) $info['message'] = "[$info[code]] $info[message]";
|
||||
@@ -146,6 +147,7 @@ abstract class DibiDriver
|
||||
"OK: " . $sql
|
||||
. ";\n-- result: $msg"
|
||||
. "\n-- takes: " . sprintf('%0.3f', $timer * 1000) . ' ms'
|
||||
. "\n-- driver: " . $this->config['driver']
|
||||
. "\n-- " . date('Y-m-d H:i:s ')
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user