Skip to content

Commit eda70b4

Browse files
authored
Merge pull request #2032 from Nidhognit/log-the-full-error-message
Log the full error message at once
2 parents bbb64a8 + c8f1707 commit eda70b4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Propel/Runtime/ActiveQuery/QueryExecutor/AbstractQueryExecutor.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,16 @@ protected function executeStatement(PreparedStatementDto $preparedStatementDto)
131131
protected function handleStatementException(Throwable $e, ?string $sql, $stmt = null): void
132132
{
133133
$internalMessage = $e->getMessage();
134-
Propel::log($internalMessage, Propel::LOG_ERR);
135134

136135
$isDebugMode = $this->connectionIsInDebugMode();
137136
if ($isDebugMode && $stmt instanceof StatementWrapper) {
138137
$sql = $stmt->getExecutedQueryString();
139138
}
140139
$publicMessage = "Unable to execute statement [$sql]";
140+
141+
$fullLogMessage = $publicMessage . PHP_EOL . "Reason: [$internalMessage]";
142+
Propel::log($fullLogMessage, Propel::LOG_ERR);
143+
141144
if ($isDebugMode) {
142145
$publicMessage .= PHP_EOL . "Reason: [$internalMessage]";
143146
}

0 commit comments

Comments
 (0)