node/error: add module skeleton

This commit is contained in:
Paul Stemmet 2022-04-16 13:31:56 +00:00
parent 12271d1c88
commit ebe7890235
Signed by: Paul Stemmet
GPG Key ID: EDEA539F594E7E75
2 changed files with 25 additions and 0 deletions

24
src/node/error.rs Normal file
View File

@ -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<T> = std::result::Result<T, NodeError>;
/// Possible errors that can be encountered while parsing
/// YAML graph structures.
#[derive(Debug)]
pub(crate) enum NodeError
{
UndefinedAlias,
Parser(ParseError),
Scanner(ScanError),
}

View File

@ -9,5 +9,6 @@
use crate::event::types::Slice; use crate::event::types::Slice;
pub(crate) mod error;
mod graph; mod graph;
mod nodes; mod nodes;