File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 19
19
- [ Defining metadata types in rust] ( ./metadata_derive.md )
20
20
- [ Metadata and tables] ( ./metadata_tables.md )
21
21
- [ Metadata schema] ( ./metadata_schema.md )
22
+
23
+ * [ Error handling] ( ./error_handling.md )
22
24
23
25
24
26
[ Crate prelude] ( ./prelude.md )
Original file line number Diff line number Diff line change
1
+ # Error handling <img align =" right " width =" 73 " height =" 45 " src =" https://raw.githubusercontent.com/tskit-dev/administrative/main/logos/svg/tskit-rust/Tskit_rust_logo.eps.svg " >
2
+
3
+ The error type is [ ` tskit::error::TskitError ` ] ( https://docs.rs/tskit/latest/tskit/error/enum.TskitError.html# ) .
4
+
5
+ This type implements ` Display ` and may thus be printed via:
6
+
7
+ ``` rust, noplayground, ignore
8
+ let x = match operation() {
9
+ Ok(y) => y,
10
+ Err(e) => panic("{}", e);
11
+ };
12
+ ```
13
+
14
+ The enum variant ` TskitError::ErrorCode ` represents integer return values from ` tskit-c ` .
15
+ When printed via ` Display ` , the detailed error message is fetched.
16
+ When printed via ` Debug ` , the numerical error code is shown.
17
+
You can’t perform that action at this time.
0 commit comments