openai_mock/validators/
validation_error.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Serialize, Deserialize)]
4pub struct ValidationError {
5    message: String,
6}
7
8impl ValidationError {
9    pub fn new(message: &str) -> Self {
10        Self {
11            message: message.to_string(),
12        }
13    }
14}
15
16impl std::fmt::Display for ValidationError {
17    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18        write!(f, "{}", self.message)
19    }
20}
21
22impl std::error::Error for ValidationError {}