shapes_converter/shex_to_uml/
uml_error.rs

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
use std::io;

use super::NodeId;
use thiserror::Error;

#[derive(Error, Debug)]
pub enum UmlError {
    #[error("NodeId has already a component")]
    NodeIdHasComponent { node_id: NodeId },

    #[error(transparent)]
    IOError {
        #[from]
        err: io::Error,
    },
    #[error("UmlError: Feature not implemented: {msg}")]
    NotImplemented { msg: String },
}

impl UmlError {
    pub fn not_implemented(msg: &str) -> UmlError {
        UmlError::NotImplemented {
            msg: msg.to_string(),
        }
    }
}