Skip to main content

utimeseries/
err.rs

1use std::io;
2
3quick_error! {
4    #[derive(Debug)]
5    pub enum Error {
6        Io(err: io::Error) {
7            from()
8            description("io error")
9            display("I/O error: {}", err)
10            cause(err)
11        }
12        IntervalOutOfRange {
13            description("interval out of range")
14            display("The interval in nanoseconds cannot be represent as an unsigned 64-bit integer")
15        }
16        TimeOutOfRange {
17            description("time out of range")
18            display("A time was out of range of acceptable times (before UNIX epoch or too large")
19        }
20        CorruptHeader {
21            description("corrupt header")
22            display("The header of the database file is corrupt or not present")
23        }
24        BlockSizeMismatch(want: u32, have: u32) {
25            description("block size mismatch")
26            display("Invalid number of items for block. Block length is {} items, but got passed {}"
27                    , want, have)
28        }
29        InvalidPathName {
30            description("invalid path name")
31            display("A given name or id resulted in an invalid path name")
32        }
33    }
34}