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
use sqlx_core::error::DatabaseError;
use std::error::Error as StdError;
use crate::error::YdbError;
use sqlx_core::error::ErrorKind as XErrorKind;

impl DatabaseError for YdbError {
    fn message(&self) -> &str {
        #[allow(deprecated)]
        self.description()
    }

    fn as_error(&self) -> &(dyn StdError + Send + Sync + 'static) {
        self
    }

    fn as_error_mut(&mut self) -> &mut (dyn StdError + Send + Sync + 'static) {
        self
    }

    fn into_error(self: Box<Self>) -> Box<dyn StdError + Send + Sync + 'static> {
        self
    }

    fn kind(&self) -> XErrorKind {
        XErrorKind::Other
    }
}