* get rid of async-trait * move rmcp to official-rust-sdk * replace master with main * update readme, change license * fix typo * Update README.md Co-authored-by: Jefry Dewangga <jefrydco@gmail.com> * fix typos --------- Co-authored-by: = <=> Co-authored-by: Jefry Dewangga <jefrydco@gmail.com>
17 lines
395 B
Rust
17 lines
395 B
Rust
use std::fmt::Display;
|
|
|
|
use crate::model::ErrorData;
|
|
|
|
pub type Error = ErrorData;
|
|
|
|
impl Display for ErrorData {
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
write!(f, "{}: {}", self.code.0, self.message)?;
|
|
if let Some(data) = &self.data {
|
|
write!(f, "({})", data)?;
|
|
}
|
|
Ok(())
|
|
}
|
|
}
|
|
|
|
impl std::error::Error for ErrorData {}
|