2019-02-05 12:01:10 +00:00
|
|
|
type
|
2020-02-05 12:29:54 +00:00
|
|
|
StorageError* = object of CatchableError
|
2019-02-05 12:01:10 +00:00
|
|
|
|
|
|
|
template raiseStorageInitError* =
|
|
|
|
raise newException(StorageError, "failure to initialize storage")
|
|
|
|
|
|
|
|
template raiseKeyReadError*(key: auto) =
|
|
|
|
raise newException(StorageError, "failed to read key " & $key)
|
|
|
|
|
|
|
|
template raiseKeyWriteError*(key: auto) =
|
|
|
|
raise newException(StorageError, "failed to write key " & $key)
|
|
|
|
|
|
|
|
template raiseKeySearchError*(key: auto) =
|
|
|
|
raise newException(StorageError, "failure during search for key " & $key)
|
|
|
|
|
|
|
|
template raiseKeyDeletionError*(key: auto) =
|
|
|
|
raise newException(StorageError, "failure to delete key " & $key)
|
|
|
|
|