[DCOM-105] Common base exception class Created: 27/Aug/12 Updated: 21/Feb/13 Resolved: 21/Feb/13 |
|
| Status: | Closed |
| Project: | Doctrine Common |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major |
| Reporter: | Till | Assignee: | Marco Pivetta |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Per our discussion on IRC/Twitter. It would be nice if all exceptions thrown had a common base, so something like this is possible to catch all exceptions from Doctrine: try { // some code here } catch (\Doctrine\Common\BaseException $e) { // something in Doctrine threw an exception, handle it here } (The name is just an example.) For reference: |
| Comments |
| Comment by Christophe Coevoet [ 27/Aug/12 ] |
|
Instead of a base class (which forbids extending the SPL exception), I would go the same way than Symfony2 and ZF: using an interface. |
| Comment by Till [ 27/Aug/12 ] |
|
That's basically what the PEAR2 RFC is doing. |
| Comment by Marco Pivetta [ 21/Feb/13 ] |
|
Duplicate of DCOM-80 |