Skip to content

Commit ee6786d

Browse files
authored
Merge pull request steveklabnik#103 from euclio/error-doc
add docs to error chain
2 parents 7ee7aa7 + 98a323b commit ee6786d

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/error.rs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
1-
#![allow(missing_docs)]
1+
//! Error types, traits and aliases.
22
3-
// TODO: Figure out how to document error-chain items in the macro
43
error_chain! {
54
errors {
6-
// Thrown whenever a crate cannot be found
5+
/// Thrown whenever a crate cannot be found
76
CrateErr(crate_name: String) {
87
description("Crate not found")
98
display("Crate not found: \"{}\"", crate_name)
109
}
1110

12-
// Thrown whenever Cargo fails to run properly when getting data for `rustdoc`
11+
/// Thrown whenever Cargo fails to run properly when getting data for `rustdoc`
1312
Cargo(status: ::std::process::ExitStatus, stderr: String) {
1413
description("Cargo command failed to run")
1514
display("Cargo failed with status {}. stderr:\n{}", status, stderr)
1615
}
1716

18-
// Thrown whenever the `JSON` grabbed from somewhere else is not what is expected.
19-
// This is usually thrown when grabbing data output from `Cargo`
17+
/// Thrown whenever the `JSON` grabbed from somewhere else is not what is expected.
18+
/// This is usually thrown when grabbing data output from `Cargo`
2019
Json(location: &'static str) {
2120
description("Unexpected JSON response")
2221
display("Unexpected JSON response from {}", location)
2322
}
2423
}
2524

2625
foreign_links {
27-
// `std::io::Error` converted to an error-chain variant
28-
Io(::std::io::Error);
29-
// `serde_json::Error` converted to an error-chain variant
30-
Serde(::serde_json::Error);
31-
// `analysis::AError` converted to an error-chain variant
32-
Analysis(::analysis::AError);
26+
Io(::std::io::Error)
27+
#[doc = "`std::io::Error` converted to an error-chain variant"];
28+
Serde(::serde_json::Error)
29+
#[doc = "`serde_json::Error` converted to an error-chain variant"];
30+
Analysis(::analysis::AError)
31+
#[doc = "`analysis::AError` converted to an error-chain variant"];
3332
}
3433
}

0 commit comments

Comments
 (0)