tskit 0.15.0

rust interface to tskit
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 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">

The error type is [`tskit::error::TskitError`](https://docs.rs/tskit/latest/tskit/error/enum.TskitError.html#).

This type implements `Display` and may thus be printed via:

```rust, noplayground, ignore
let x = match operation() {
    Ok(y) => y,
    Err(e) => panic("{}", e);
};
```

The enum variant `TskitError::ErrorCode` represents integer return values from `tskit-c`.
When printed via `Display`, the detailed error message is fetched.
When printed via `Debug`, the numerical error code is shown.