Skip to content

Commit

Permalink
fix db exception
Browse files Browse the repository at this point in the history
  • Loading branch information
joyqi committed Mar 25, 2022
1 parent 0bdf872 commit 6100695
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions var/Typecho/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,10 @@ public static function error(\Throwable $exception)
//覆盖原始错误信息
$message = 'Database Server Error';

if ($exception instanceof \Typecho\Db\Adapter\SQLException) {
if ($exception instanceof \Typecho\Db\Adapter\ConnectionException) {
$code = 503;
$message = 'Error establishing a database connection';
} elseif ($exception instanceof \Typecho\Db\Query\Exception) {
} elseif ($exception instanceof \Typecho\Db\Adapter\SQLException) {
$message = 'Database Query Error';
}
}
Expand Down

0 comments on commit 6100695

Please sign in to comment.