neighborhoods / exception-component
Provides consistent transient and non-transient exception types.
Installs: 6 001
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 19
Forks: 2
Open Issues: 2
Requires
- php: ^7.2|^8
Requires (Dev)
- roave/security-advisories: dev-master
This package is auto-updated.
Last update: 2024-12-19 23:11:25 UTC
README
Provides a consistent transient and non-transient exception types.
These are primarily intended to be used in Repositories. Repositories are experts at interacting with their associated storages. They should catch storage exceptions, interpret them (since a lot of storage exceptions have esoteric codes or, worse, esoteric message strings that need to be identified for certain cases) and decompose the specific storage exception to be either Transient (this will get better) or NonTransient (this needs a human, i.e. it will not get better.)
Example
//... } catch (\Doctrine\DBAL\ConnectionException $connectionException) { throw (new TransientException())->setPrevious($pdoException); } return $this;