-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.rs
More file actions
47 lines (43 loc) · 1.64 KB
/
errors.rs
File metadata and controls
47 lines (43 loc) · 1.64 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
use std::io;
use serde_json;
error_chain! {
// The type defined for this error. These are the conventional
// and recommended names, but they can be arbitrarily chosen.
// It is also possible to leave this block out entirely, or
// leave it empty, and these names will be used automatically.
types {
Error, ErrorKind, ChainErr, Result;
}
// Automatic conversions between this error chain and other
// error chains. In this case, it will e.g. generate an
// `ErrorKind` variant called `Dist` which in turn contains
// the `rustup_dist::ErrorKind`, with conversions from
// `rustup_dist::Error`.
//
// This section can be empty.
links {
// rustup_dist::Error, rustup_dist::ErrorKind, Dist;
// rustup_utils::Error, rustup_utils::ErrorKind, Utils;
}
// Automatic conversions between this error chain and other
// error types not defined by the `error_chain!`. These will be
// wrapped in a new error with, in this case, the
// `ErrorKind::Temp` variant. The description and cause will
// forward to the description and cause of the original error.
//
// This section can be empty.
foreign_links {
io::Error, IoError;
serde_json::error::Error, JsonError;
// temp::Error, Temp;
}
// Define additional `ErrorKind` variants. The syntax here is
// the same as `quick_error!`, but the `from()` and `cause()`
// syntax is not supported.
errors {
// InvalidToolchainName(t: String) {
// description("invalid toolchain name")
// display("invalid toolchain name: '{}'", t)
// }
}
}