Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/dfx/src/commands/canister/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,15 @@ pub async fn exec(env: &dyn Environment, opts: InfoOpts) -> DfxResult {
.or_else(|_| canister_id_store.get(callee_canister))?;

fetch_root_key_if_needed(env).await?;
let controller_blob = agent
let controller_blob = match agent
.read_state_canister_info(canister_id, "controllers", false)
.await
.with_context(|| format!("Failed to read controllers of canister {}.", canister_id))?;
{
Err(AgentError::LookupPathUnknown(_) | AgentError::LookupPathAbsent(_)) => {
bail!("Canister {canister_id} does not exist.")
}
r => r.with_context(|| format!("Failed to read controllers of canister {canister_id}."))?,
};
let cbor: Value = serde_cbor::from_slice(&controller_blob)
.map_err(|_| anyhow!("Invalid cbor data in controllers canister info."))?;
let controllers = if let Value::Array(vec) = cbor {
Expand Down