error_chain! {
errors {
FetchVersionFailure {
description("Failed to fetch crate version from crates.io")
}
InvalidCratesIoJson {
description("Invalid JSON (the crate may not exist)")
}
NoCrate(name: String) {
description("The crate could not be found on crates.io.")
display("The crate `{}` could not be found on crates.io.", name)
}
NoVersionsAvailable {
description("No available versions exist. Either all were yanked \
or only prerelease versions exist. Trying with the \
--allow-prerelease flag might solve the issue."
)
}
ParseCargoToml {
description("Unable to parse external Cargo.toml")
}
MissingManifest {
description("Unable to find Cargo.toml")
}
InvalidManifest {
description("Cargo.toml missing expected `package` or `project` fields")
}
UnexpectedRootManifest {
description("Found virtual manifest, but this command requires running against an \
actual package in this workspace.")
}
NonExistentTable(table: String) {
description("non existent table")
display("The table `{}` could not be found.", table)
}
NonExistentDependency(name: String, table: String) {
description("non existent dependency")
display("The dependency `{}` could not be found in `{}`.", name, table)
}
}
}