1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
use std::{error::Error, fmt::Display};
/**
The Error that is returned if any of the operations in this crate
fails.
*/
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct DataverseError {
pub message: String,
}
impl DataverseError {
pub fn new(message: String) -> Self {
Self { message }
}
}
impl Error for DataverseError {}
impl Display for DataverseError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(&self.message)
}
}