Task #87852

Pass original DBALException along with SqlErrorException

Added by Christian Futterlieb 9 months ago. Updated 4 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2019-03-06
Due date:
% Done:

100%

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.

Associated revisions

Revision 43d16005 (diff)
Added by Christian Futterlieb 9 months ago

[BUGFIX] Pass original DBALException along with SqlErrorException

When a
TYPO3\CMS\Extbase\Persistence\Generic\Storage\Exception\SqlErrorException
is thrown, pass the previous exception as 3rd parameter to the
constructor, to get the real reason for the exception.

Resolves: #87852
Releases: master, 9.5, 8.7
Change-Id: I20d711c0038b51a1d0c12d9a975d8c0da1f510f4
Reviewed-on: https://review.typo3.org/c/59888
Reviewed-by: Benni Mack <>
Reviewed-by: Christian Futterlieb <>
Reviewed-by: Oliver Klee <>
Reviewed-by: Georg Ringer <>
Tested-by: TYPO3com <>
Tested-by: Georg Ringer <>

Revision 62a78be8 (diff)
Added by Christian Futterlieb 4 months ago

[BUGFIX] Pass original DBALException along with SqlErrorException

When a
TYPO3\CMS\Extbase\Persistence\Generic\Storage\Exception\SqlErrorException
is thrown, pass the previous exception as 3rd parameter to the
constructor, to get the real reason for the exception.

Resolves: #87852
Releases: master, 9.5, 8.7
Change-Id: I20d711c0038b51a1d0c12d9a975d8c0da1f510f4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/59960
Tested-by: TYPO3com <>
Tested-by: Andreas Fernandez <>
Reviewed-by: Andreas Fernandez <>

Revision 4fbb456c (diff)
Added by Christian Futterlieb 4 months ago

[BUGFIX] Pass original DBALException along with SqlErrorException

When a
TYPO3\CMS\Extbase\Persistence\Generic\Storage\Exception\SqlErrorException
is thrown, pass the previous exception as 3rd parameter to the
constructor, to get the real reason for the exception.

Resolves: #87852
Releases: master, 9.5, 8.7
Change-Id: I20d711c0038b51a1d0c12d9a975d8c0da1f510f4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/59961
Tested-by: TYPO3com <>
Tested-by: Andreas Fernandez <>
Reviewed-by: Andreas Fernandez <>

History

#1 Updated by Gerrit Code Review 9 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/59888

#2 Updated by Gerrit Code Review 9 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/59888

#3 Updated by Gerrit Code Review 9 months ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/59961

#4 Updated by Christian Futterlieb 9 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#5 Updated by Benni Mack 7 months ago

  • Status changed from Resolved to Closed

#6 Updated by Gerrit Code Review 4 months ago

  • Status changed from Closed to Under Review

Patch set 2 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/59960

#7 Updated by Gerrit Code Review 4 months ago

Patch set 2 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/59961

#8 Updated by Christian Futterlieb 4 months ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF