missing key should return appropriate error

This commit is contained in:
Dmitriy Ryajov 2022-09-19 17:12:34 -06:00
parent 5e30230a9f
commit 2680789884
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4

View File

@ -133,7 +133,7 @@ method get*(self: FSDatastore, key: Key): Future[?!seq[byte]] {.async.} =
return failure "Path is protected!"
if not fileExists(path):
return success(newSeq[byte]())
return failure(newException(DatastoreKeyNotFound, "Key doesn't exist"))
var
file: File