lldap/server/src/domain/ldap/error.rs
Valentin Tolmer 85b4fc4406 server: refactor ldap_handler
Split it into several files, move them into the domain folder, introduce
`LdapError` for better control flow.
2022-10-17 14:34:47 +02:00

18 lines
400 B
Rust

use ldap3_proto::LdapResultCode;
#[derive(Debug, PartialEq)]
pub struct LdapError {
pub code: LdapResultCode,
pub message: String,
}
impl std::fmt::Display for LdapError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(&self.message)
}
}
impl std::error::Error for LdapError {}
pub type LdapResult<T> = std::result::Result<T, LdapError>;