Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 12.4] [TASK] Clarify hint about doctrine exceptions #5216

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions Documentation/ApiOverview/Database/TipsAndTricks/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,12 @@ Various tips and tricks

$result = $queryBuilder->executeQuery();

* Doctrine DBAL throws exceptions if something goes wrong when calling
:ref:`executeQuery() <database-query-builder-execute-query>` or
:ref:`executeStatement() <database-query-builder-execute-statement>`. The
exception type is :php:`\Doctrine\DBAL\Exception`, which can be caught and
transferred to a better error message if the application should expect
query errors. Note that this is not good habit and often indicates an
architectural flaw in the application at a different layer.
* Doctrine DBAL throws exceptions if something goes wrong when calling API methods.
The exception type is :php:`\Doctrine\DBAL\Exception`. Typical extensions should
usually not catch such exceptions but let it bubble up to be handled by the
global TYPO3 core error and exception handling: They most often indicate a
broken connection, database schema or programming error and extensions should
usually not try to hide away or escalate them on their own.

* :php:`count() <database-query-builder-count>` query types using the
:ref:`query builder <database-query-builder>` normally call
Expand Down