Handle exceptions.
This commit is contained in:
parent
0892729efb
commit
65be21e0ab
6
chat.php
6
chat.php
@ -18,7 +18,8 @@ if ($msg) {
|
||||
try {
|
||||
db::c()->query('INSERT INTO `chat` (`uid`, `msg`) VALUES (?i, "?s")', $uid, $msg);
|
||||
} catch (\Krugozor\Database\Mysql\Exception $e) {
|
||||
echo "DB Error:". $e->getMessage() ."On Line:". $e->getLine();
|
||||
echo "DB Error: ". $e->getMessage() . PHP_EOL;
|
||||
echo "File: " . $e->getFile() . "[".$e->getLine()."]". PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,7 +34,8 @@ function show_messages()
|
||||
`type`
|
||||
FROM `chat` ORDER BY `id` LIMIT 50');
|
||||
} catch (\Krugozor\Database\Mysql\Exception $e) {
|
||||
echo "DB Error:". $e->getMessage() ."On Line:". $e->getLine();
|
||||
echo "DB Error: ". $e->getMessage() . PHP_EOL;
|
||||
echo "File: " . $e->getFile() . "[".$e->getLine()."]". PHP_EOL;
|
||||
}
|
||||
|
||||
while ($message = $chat->fetch_assoc()) {
|
||||
|
Loading…
Reference in New Issue
Block a user