nim-eth/eth/trie/backends/backend_defs.nim

19 lines
602 B
Nim
Raw Normal View History

2019-02-05 12:01:10 +00:00
type
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)