KeyValueStore icon indicating copy to clipboard operation
KeyValueStore copied to clipboard

Moved to a more structured hierarchy

Open EmanueleMinotto opened this issue 10 years ago • 1 comments

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 avatar Jan 06 '16 15:01 EmanueleMinotto

ping @Ocramius @beberlei

EmanueleMinotto avatar Jan 27 '16 19:01 EmanueleMinotto