diff --git a/src/node/error.rs b/src/node/error.rs new file mode 100644 index 0000000..eac5df9 --- /dev/null +++ b/src/node/error.rs @@ -0,0 +1,24 @@ +/* + * This Source Code Form is subject to the terms of the + * Mozilla Public License, v. 2.0. If a copy of the MPL + * was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +//! This module contains the errors that may surface while +//! parsing a YAML event stream into memory. + +use crate::{event::error::ParseError, scanner::error::ScanError}; + +/// Result type returned by [`yary::node`](super) +pub(crate) type NodeResult = std::result::Result; + +/// Possible errors that can be encountered while parsing +/// YAML graph structures. +#[derive(Debug)] +pub(crate) enum NodeError +{ + UndefinedAlias, + + Parser(ParseError), + Scanner(ScanError), +} diff --git a/src/node/mod.rs b/src/node/mod.rs index 9db3b80..d7e3a06 100644 --- a/src/node/mod.rs +++ b/src/node/mod.rs @@ -9,5 +9,6 @@ use crate::event::types::Slice; +pub(crate) mod error; mod graph; mod nodes;