storage-manager: get
returns an error on a missing key, return None
instead?
#1464
Labels
api fix
Correct API
breaking-change
Indicates that the issue implies a breaking change (be it at compile time or at runtime)
enhancement
Existing things could work better
Describe the feature
The method
get
:zenoh/plugins/zenoh-backend-traits/src/lib.rs
Lines 247 to 251 in ddcc8f1
returns, at least in some implementation, an error when the requested key is missing.
I believe it should return a
ZResult<Option<Vec<StoredData>>>
where theNone
indicates that there is no entry for that key expression. This would allow differentiating an actual error of the underlying Storage from a missing key.Right now, for instance, the Memory backend returns an error: https://github.com/eclipse-zenoh/zenoh/blob/main/plugins/zenoh-plugin-storage-manager/src/memory_backend/mod.rs#L131
The text was updated successfully, but these errors were encountered: