mirror of
https://github.com/friendica/friendica
synced 2025-04-22 11:50:11 +00:00
- 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:
parent
813db7956f
commit
57438afbb3
4 changed files with 42 additions and 31 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue