This commit is contained in:
2025-12-31 00:19:29 +08:00
parent c943d6258b
commit 89d5b604d6
5 changed files with 26 additions and 18 deletions
+10 -6
View File
@@ -123,13 +123,15 @@ class Command extends Component
return $result;
} catch (Throwable $throwable) {
$this->getLogger()->failure(throwable($throwable), 'mysql');
$this->getLogger()->json_log($throwable);
if ($this->isRefresh($throwable)) return $this->search($method);
if ($this->isRefresh($throwable)) {
return $this->search($method);
}
$errorMsg = $throwable->getMessage() . PHP_EOL . ' Sql: ' . $this->sql . '.' . json_encode($this->params);
return $this->getLogger()->failure($errorMsg . PHP_EOL, 'mysql');
return $this->getLogger()->logCategory($errorMsg . PHP_EOL, 'mysql');
} finally {
$this->connection->release($client);
}
@@ -169,13 +171,15 @@ class Command extends Component
return $result == 0 ? $prepare->rowCount() : (int)$result;
} catch (Throwable $throwable) {
$this->getLogger()->failure(throwable($throwable), 'mysql');
$this->getLogger()->json_log($throwable);
if ($this->isRefresh($throwable)) return $this->_prepare();
if ($this->isRefresh($throwable)) {
return $this->_prepare();
}
$errorMsg = $throwable->getMessage() . PHP_EOL . ' Sql: ' . $this->sql . '.' . json_encode($this->params);
return $this->getLogger()->failure($errorMsg . PHP_EOL, 'mysql');
return $this->getLogger()->logCategory($errorMsg . PHP_EOL, 'mysql');
} finally {
$this->connection->release($client);
}