Adjusts exception handling in leveldbds to match what can be raised by leveldb iterator callbacks.

This commit is contained in:
Ben 2024-05-22 09:35:02 +02:00
parent 3ed00d666c
commit ff1bf84794
No known key found for this signature in database
GPG Key ID: 541B9D8C9F1426A1

View File

@ -113,17 +113,9 @@ method query*(
return success (key.some, valueStr.toBytes())
except LevelDbException as e:
return failure("LevelDbDatastore.query -> next exception: " & $e.msg)
except Exception as e:
return failure("Unknown exception in LevelDbDatastore.query -> next: " & $e.msg)
proc dispose(): Future[?!void] {.async.} =
try:
dbIter.dispose()
return success()
except LevelDbException as e:
return failure("LevelDbDatastore.query -> dispose exception: " & $e.msg)
except Exception as e:
return failure("Unknown exception in LevelDbDatastore.query -> dispose: " & $e.msg)
dbIter.dispose()
return success()
iter.next = next