aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-external-packages/src/seld/json_lint/duplicate_key_exception.rs
blob: 17e6a90bb691b5630d17901f1b827f721f85a7c1 (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
//! ref: composer/vendor/seld/jsonlint/src/Seld/JsonLint/DuplicateKeyException.php

use indexmap::IndexMap;
use shirabe_php_shim::PhpMixed;

#[derive(Debug)]
pub struct DuplicateKeyException {
    pub message: String,
    pub code: i64,
    pub details: IndexMap<String, PhpMixed>,
}

impl DuplicateKeyException {
    pub fn get_details(&self) -> &IndexMap<String, PhpMixed> {
        &self.details
    }
}

impl std::fmt::Display for DuplicateKeyException {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "{}", self.message)
    }
}

impl std::error::Error for DuplicateKeyException {}