propelorm / Propel2

Propel2 is an open-source high-performance Object-Relational Mapping (ORM) for modern PHP
http://propelorm.org/
MIT License
1.26k stars 399 forks source link

BC break: QueryExecutionException instead of PropelException #1787

Open emicks opened 3 years ago

emicks commented 3 years ago

I am facing a bc break introduced with the refactoring in #1747. As far as I can see, Criteria::handleStatementException() in the original code always throws a PropelException, while the refactored code throws a QueryExecutionException (a RuntimeException). So now when I catch a PropelException in the calling code, I don't catch the QueryExecutionException. Perhaps inheriting QueryExecutionException from PropelException is a feasible way to solve this issue.

dereuromark commented 2 years ago

@mwringler and team: Do we have any feedback on this regarding the topic at hand? Do we want to adjust here something in terms of next beta release?

mringler commented 2 years ago

Personally, I think extending RuntimeException instead of PropelException is correct here, since the wrapped exceptions that lead to the QueryExecutionException are not caused by Propel, but by the underlying DB connection. But I don't mind changing it back.