Skip to main content

rudof_rdf/rdf_core/visualizer/
errors.rs

1use crate::rdf_core::visualizer::{VisualRDFNode, uml_converter::errors::UmlConverterError};
2use std::io;
3use thiserror::Error;
4
5/// Represents all possible errors that can occur during RDF visualization operations.
6#[derive(Error, Debug)]
7pub enum RdfVisualizerError {
8    /// Error wrapping I/O operations failures.
9    ///
10    /// This variant is used for any standard I/O errors that occur during
11    /// file operations, network access, or other I/O-related tasks in the
12    /// visualization process.
13    ///
14    /// # Fields
15    /// - `err`: The underlying `std::io::Error` that was encountered
16    #[error(transparent)]
17    IOError {
18        #[from]
19        err: io::Error,
20    },
21
22    /// Error when a specific RDF node cannot be found in the visual graph.
23    ///
24    /// This occurs when trying to access or manipulate a node that does not
25    /// exist in the current visualization graph.
26    ///
27    /// # Fields
28    /// - `node`: The `VisualRDFNode` that was not found
29    #[error("VisualRDFNode not found: {node} in Visual graph")]
30    NodeNotFound { node: VisualRDFNode },
31
32    /// Error wrapping UML converter operation failures.
33    ///
34    /// This variant encapsulates errors that originate from the UML conversion
35    /// process, such as PlantUML execution failures or diagram generation issues.
36    ///
37    /// # Fields
38    /// - `err`: The underlying `UmlConverterError` that was encountered
39    #[error(transparent)]
40    UmlConverterError {
41        #[from]
42        err: UmlConverterError,
43    },
44}