Provide a dedicated exception for statement timeout
Author: stofCreated Sep 21, 2026Updated Sep 21, 2026
Feature Request
What
Currently, the ExceptionConverter does not have a dedicated exception for statement timeouts. It would be great to have one instead of getting this as a generic DriverException
Why
A statement timeout is an exception for which applications might want to recover. For instance, packagist.org does it in several places, for instance in https://github.com/composer/packagist/pull/1868 Currently, it requires catching the generic DriverException, identifying manually the statement timeout errors (the code of packagist identifies it only for MySQL as it does not need cross-platform support) and rethrowing other kinds of errors.
How
This should be implemented in the ExceptionConverter of each platform.
Source: doctrine/dbal