1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//! Top-level error types for Conjure-Oxide.

use serde_json::Error as JsonError;
use thiserror::Error;

pub type Result<T> = std::result::Result<T, Error>;

#[derive(Debug, Error)]
pub enum Error {
    #[error("JSON error: {0}")]
    JSON(#[from] JsonError),

    #[error("Error parsing model: {0}")]
    Parse(String),

    #[error("{0} is not yet implemented.")]
    NotImplemented(String),

    #[error(transparent)]
    Other(#[from] anyhow::Error),
}