Skip to main content

kmp_plugin_api/domain/
interpretation_error.rs

1use std::error::Error;
2use std::fmt;
3
4#[derive(Debug, Clone, PartialEq, Eq)]
5pub struct InterpretationError {
6    message: String,
7}
8
9impl InterpretationError {
10    pub fn new(message: impl Into<String>) -> Self {
11        Self {
12            message: message.into(),
13        }
14    }
15}
16
17impl fmt::Display for InterpretationError {
18    fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
19        formatter.write_str(&self.message)
20    }
21}
22
23impl Error for InterpretationError {}