- Moved the description for the specific storage exception first

- Introduced exceptions for try to get invalid storage
- ReferenceStorageException now extends StorageException
This commit is contained in:
Philipp 2021-08-10 21:30:40 +02:00
parent 813db7956f
commit 57438afbb3
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD
4 changed files with 42 additions and 31 deletions

View file

@ -122,6 +122,14 @@ abstract class StorageTest
There are two intended types of exceptions for storages
### `ReferenceStorageExecption`
This storage exception should be used in case the caller tries to use an invalid references.
This could happen in case the caller tries to delete or update an unknown reference.
The implementation of the storage backend must not ignore invalid references.
Avoid throwing the common `StorageExecption` instead of the `ReferenceStorageException` at this particular situation!
### `StorageException`
This is the common exception in case unexpected errors happen using the storage backend.
@ -145,14 +153,6 @@ class ExampleStorage implements ISelectableStorage
}
```
### `ReferenceStorageExecption`
This storage exception should be used in case the caller tries to use an invalid references.
This could happen in case the caller tries to delete or update an unknown reference.
The implementation of the storage backend must not ignore invalid references.
Avoid throwing the common `StorageExecption` instead of the `ReferenceStorageException` at this particular situation!
## Example
Here an hypotetical addon which register a useless storage backend.