aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/json/json_validation_exception.rs
blob: 27661e387df98e5d32dc60babecfcb502c0ed1c1 (plain)
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
27
28
//! ref: composer/src/Composer/Json/JsonValidationException.php

use shirabe_php_shim::Exception;

#[derive(Debug)]
pub struct JsonValidationException {
    inner: Exception,
    errors: Vec<String>,
}

impl JsonValidationException {
    pub fn new(message: String, errors: Vec<String>) -> Self {
        Self {
            inner: Exception::new(message),
            errors,
        }
    }

    pub fn get_errors(&self) -> &Vec<String> {
        &self.errors
    }
}

shirabe_php_shim::impl_php_exception!(
    JsonValidationException,
    inner,
    r"Composer\Json\JsonValidationException"
);