- Issue created by @solideogloria
- Status changed to Needs review
almost 2 years ago 10:47am 10 February 2023 - 🇮🇹Italy mondrake 🇮🇹
Maybe \Throwable is too high in the inheritance tree? In the end aren't we facing a kind of \RuntimeException when the database fails?
- 🇮🇳India ankitsingh0188 Pune
What if we get the
DatabaseException
?In that case
$e->getMessage()
will not work as mentioned Steps to reproducesection.I think the exception interface should extend the
\Throwable
with respect to what you're catching is something that is a\Throwable
. Not every implementer of
DatabaseException
extendsRuntimeException
, though. SeeInvalidQueryException
.class InvalidQueryException extends \InvalidArgumentException implements DatabaseException {}
- Status changed to RTBC
almost 2 years ago 2:31pm 10 February 2023 The proposed patch is guaranteed to work with existing code, and I think it's the best solution.
- 🇬🇧United Kingdom catch
Overall I feel like this shouldn't be necessary, however to make it unnecessary I think we'd have to change the database API's InvalidArgumentExceptions to assertions. Also discussed briefly with @longwave who pointed out that Guzzle has the same pattern.
So.. Committed 87d90f9 and pushed to 10.1.x. Thanks!
- Status changed to Fixed
almost 2 years ago 3:59pm 13 February 2023 Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
over 1 year ago 2:28am 10 September 2023