try!(config.shell().status("Owner", format!("adding `{:?}` to `{}`",
v, name)));
try!(registry.add_owners(&name, &v).map_err(|e| {
- human(format!("failed to add owners: {}", e))
+ human(format!("failed to add owners to crate {}: {}", name, e))
}));
}
None => {}
try!(config.shell().status("Owner", format!("removing `{:?}` from `{}`",
v, name)));
try!(registry.remove_owners(&name, &v).map_err(|e| {
- human(format!("failed to remove owners: {}", e))
+ human(format!("failed to remove owners from crate {}: {}", name, e))
}));
}
None => {}
if opts.list {
let owners = try!(registry.list_owners(&name).map_err(|e| {
- human(format!("failed to list owners: {}", e))
+ human(format!("failed to list owners of crate {}: {}", name, e))
}));
for owner in owners.iter() {
print!("{}", owner.login);
Unauthorized,
TokenMissing,
Io(io::Error),
+ NotFound,
}
#[derive(RustcDecodable)]
0 => {} // file upload url sometimes
200 => {}
403 => return Err(Error::Unauthorized),
+ 404 => return Err(Error::NotFound),
_ => return Err(Error::NotOkResponse(response))
}
Error::Unauthorized => write!(f, "unauthorized API access"),
Error::TokenMissing => write!(f, "no upload token found, please run `cargo login`"),
Error::Io(ref e) => write!(f, "io error: {}", e),
+ Error::NotFound => write!(f, "cannot find crate"),
}
}
}