1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
use failure; error_chain! { foreign_links { Io(::std::io::Error); StringFromUtf8(::std::string::FromUtf8Error); ParseInt(::std::num::ParseIntError); PathStripPrefix(::std::path::StripPrefixError); Plist(::plist::Error); Regex(::regex::Error); Json(::json::Error); Ignore(::ignore::Error); Toml(::toml::de::Error); } errors { PackagesCannotBeCompiledForPlatform(packages: Vec<String>) { description("Cannot compile selected packages for the selected platform") display("{:?} cannot be compiled for the selected platform (see project's [package.metadata.dinghy] in Cargo.toml)", packages) } Cargo(err: String) { description("A cargo error") display("{:?}", err) } } } impl From<failure::Error> for Error { fn from(err: failure::Error) -> Error { Error::from_kind(ErrorKind::Cargo(err.to_string())) } }