1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use failure::Fail;
pub type Result<T> = ::std::result::Result<T, Error>;
#[derive(Fail, Debug)]
pub enum Error {
#[fail(
display = "Value node is not initialized (Index = {})",
index
)]
ValueUninitialized { index: usize },
#[fail(
display = "Derivative is not initialized (Index = {})",
index
)]
DerivUninitialized { index: usize },
#[fail(display = "Node type mismatch (Index = {})", index)]
NodeTypeError { index: usize },
#[fail(display = "Duplicated name (name = {})", name)]
DuplicatedName { name: String },
#[fail(display = "Variable name is not defined (name = {})", name)]
UndefinedName { name: String },
#[fail(display = "JSON serialization failed: {:?})", error)]
JSONSerializeFailed { error: serde_json::error::Error },
}