doctrine / KeyValueStore

Abstraction for Key-Value to Plain Old PHP Object mapping
http://www.doctrine-project.org
MIT License
200 stars 59 forks source link

Moved to a more structured hierarchy #76

Open EmanueleMinotto opened 8 years ago

EmanueleMinotto commented 8 years ago

With this structure every exception thrown by the key value store is marked with a specific interface.

Use case:

try {
    // extract values from a DBAL storage
} catch (\Doctrine\KeyValueStore\Exception\NotFoundException $e) {
    // data not found
} catch (\Doctrine\KeyValueStore\Storage\Exception\Exception $e) {
    // generic storage-level exception
} catch (\Doctrine\KeyValueStore\Exception\RuntimeException $e) {
    // EntityManager or UnitOfWork runtime exception (extends \RuntimeException)
} catch (\Doctrine\KeyValueStore\Exception\Exception $e) {
    // EntityManager or UnitOfWork exception (extends \Exception)
} catch (\Doctrine\KeyValueStore\Exception $e) {
    // generic key value store exception
} catch (\Exception $e) {
    // generic exception
}

This is a RFC with the basic structure only, later I'll add message methods (following this article) and tests.

EmanueleMinotto commented 8 years ago

ping @Ocramius @beberlei