#![allow(missing_docs)]
use reqwest;
use serde_json;
use std::io;
use std::path::PathBuf;
use url::Url;
error_chain! {
foreign_links {
Io(io::Error);
Json(serde_json::Error);
}
errors {
CouldNotAccessUrl(url: Url) {
description("could not access URL")
display("could not access '{}'", &url)
}
CouldNotGetOutput(name: String) {
description("could not get WhizzML output")
display("could not get WhizzML output '{}'", &name)
}
CouldNotReadFile(path: PathBuf) {
description("could not read file")
display("could not read file '{}'", &path.display())
}
OutputNotAvailable {
description("WhizzML output is not (yet?) available")
display("WhizzML output is not (yet?) available")
}
UnexpectedHttpStatus(status: reqwest::StatusCode, body: String) {
description("Unexpected HTTP status")
display("{} ({})", &status, &body)
}
WrongResourceType(expected: &'static str, found: String) {
description("Wrong BigML resource type found")
display("Expected BigML resource ID starting with '{}', found '{}'",
expected, &found)
}
}
}