apple_bom/
error.rs

1// Copyright 2022 Gregory Szorc.
2//
3// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
4// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
5// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
6// option. This file may not be copied, modified, or distributed
7// except according to those terms.
8
9#[derive(Debug, thiserror::Error)]
10pub enum Error {
11    #[error("(de)serialization error: {0}")]
12    Scroll(#[from] scroll::Error),
13
14    #[error("unable to parse variable name as UTF-8")]
15    BadVariableString,
16
17    #[error("bad index into BOM data")]
18    BadIndex,
19
20    #[error("data type {0} not found")]
21    NoVar(String),
22
23    #[error("illegal BOM path \"{0}\": {1}")]
24    BadPath(String, &'static str),
25
26    #[error("I/O error: {0}")]
27    Io(#[from] std::io::Error),
28
29    #[error("bad arguments: {0}")]
30    CliBadArgs(String),
31
32    #[error("unknown block type")]
33    UnknownBlockType,
34
35    #[error("invalid time value")]
36    BadTime,
37}