From NLnetLabs/cascade-hsm-bridge#32 (comment).
Currently get_key() cannot distinguish, nor can its callers, between item not found and an actual error, both result in an internal error.
If get_key() could return Result<Option< instead that would allow the caller to distinguish the cases.
Alternatively, if the do_request() fn did not hide the actual error (item not found) by mapping it to a generic internal error, the callers would be able to detect item not found as the actual error.
Either way, some improvement is needed here.
From NLnetLabs/cascade-hsm-bridge#32 (comment).
Currently
get_key()cannot distinguish, nor can its callers, between item not found and an actual error, both result in an internal error.If
get_key()could returnResult<Option<instead that would allow the caller to distinguish the cases.Alternatively, if the
do_request()fn did not hide the actual error (item not found) by mapping it to a generic internal error, the callers would be able to detect item not found as the actual error.Either way, some improvement is needed here.