1
0
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:
David Grudl
2007-05-11 22:25:32 +00:00
parent d03f60c43c
commit f766827219
19 changed files with 123 additions and 230 deletions

View File

@@ -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 ')
);
}