mirror of
https://github.com/logos-storage/nim-datastore.git
synced 2026-01-07 16:13:07 +00:00
Return err from modify fn
This commit is contained in:
parent
d4736cabf2
commit
f8bc104ecb
@ -54,7 +54,7 @@ method modifyGet*(self: SQLiteDatastore, key: Key, fn: ModifyGet): Future[?!seq[
|
|||||||
try:
|
try:
|
||||||
(maybeNewData, aux) = await fn(maybeCurrentData)
|
(maybeNewData, aux) = await fn(maybeCurrentData)
|
||||||
except CatchableError as err:
|
except CatchableError as err:
|
||||||
return failure("Error running modify function: " & err.msg)
|
return failure(err)
|
||||||
|
|
||||||
if maybeCurrentData == maybeNewData:
|
if maybeCurrentData == maybeNewData:
|
||||||
# no need to change currently stored value
|
# no need to change currently stored value
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user