Actions
Task #87852
closedPass original DBALException along with SqlErrorException
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2019-03-06
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
no-brainer
Sprint Focus:
Description
When a TYPO3\CMS\Extbase\Persistence\Generic\Storage\Exception\SqlErrorException
is thrown, register the previous exception as 3rd parameter to the exception's constructor:
try {
$this->connectionPool->getConnectionForTable($tableName)->update($tableName, $fieldValues, $where);
} catch (DBALException $e) {
throw new SqlErrorException($e->getPrevious()->getMessage(), 1470230768, $e);
}
Like this, it is possible to determine, what exactly went wrong and then for example re-try, log or do something else. I'll submit that tiny patch in a minute.
Note: I set TYPO3 version to '10', but I'd like to add this to 9.5 and 8.7 too.
Actions