/// Sets an epitaph on `server_end` for a capability routing failure, and logs the error. Logs a
/// failure to route a capability. Formats `err` as a `String`, but elides the type if the error is
/// a `RoutingError`, the common case.
Sets an epitaph on `server_end` for a capability routing failure, and logs the error. Logs a
failure to route a capability.
Sets an epitaph on ` server_end ` for a capability routing failure and logs the error . Logs a failure to route a capability .
pub(super) async fn report_routing_failure(
    target: &Arc<ComponentInstance>,
    cap: &ComponentCapability,
    err: &ModelError,
    server_end: zx::Channel,
) {
    let _ = server_end.close_with_epitaph(err.as_zx_status());
    let err_str = match err {
        ModelError::RoutingError { err } => err.to_string(),
        _ => err.to_string(),
    };
    target
        .log(
            Level::Error,
            format!(
                "Failed to route {} `{}` with target component `{}`: {}",
                cap.type_name(),
                cap.source_id(),
                &target.abs_moniker,
                &err_str
            ),
        )
        .await
}
pub ( super ) async fn report_routing_failure ( target : & Arc < ComponentInstance > , cap : & ComponentCapability , err : & ModelError , server_end : zx :: Channel , ) { let _ = server_end . close_with_epitaph ( err . as_zx_status ( ) ) ; let err_str = match err { ModelError :: RoutingError { err } => err . to_string ( ) , _ => err . to_string ( ) , } ; target . log ( Level :: Error , format ! ( " " cap type_name ( ) cap source_id ( ) target abs_moniker err_str ) , ) . await }
Sets an epitaph on `server_end` for a capability routing failure, and logs the error.
Sets an epitaph on ` server_end ` for a capability routing failure and logs the error .
target
&Arc<ComponentInstance>
cap
&ComponentCapability
err
&ModelError
server_end
zx::Channel