Skip to content

Retain zbus errors on connection failures #95

@complexspaces

Description

@complexspaces

Our current implementation of SecretService::connect is non-ideal as it throws away valuable failure information when it fails to connect:

pub(crate) fn handle_conn_error(e: zbus::Error) -> Error {
match e {
zbus::Error::InterfaceNotFound | zbus::Error::Address(_) => Error::Unavailable,
zbus::Error::InputOutput(e) if e.kind() == std::io::ErrorKind::NotFound => {
Error::Unavailable
}
e => e.into(),
}
}

It would be better if Error::Unavailable changed from a unit variant to hold the original zbus error. Its currently unclear if this can be done without a major breaking change.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions