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