Add boxed RegistryError to AdminKeyVerifierError
Before AdminKeyVerifierError required the error that could
be used a source to be Send. The RegistryError is not
send and therefore could not be passed. After removing
this requirement, which was not needed, the RegistryError
can now be boxed and added as source.
@@ -131,11 +131,10 @@ impl AdminKeyVerifier for dyn RegistryReader {
/// registry and the node has the given key. Otherwise, the key is not permitted.
fn is_permitted(&self, node_id: &str, key: &[u8]) -> Result<bool, AdminKeyVerifierError> {
let node_opt = self.fetch_node(node_id).map_err(|err| {
- AdminKeyVerifierError::new(&format!(
- "Failed to lookup node '{}' in registry: {}",
- node_id,
- err.to_string()
- ))
+ AdminKeyVerifierError::new_with_source(
+ &format!("Failed to lookup node '{}' in registry", node_id),
+ Box::new(err),
+ )
})?;
Ok(match node_opt {
Some(node) => node.has_key(&to_hex(key)),
