server: refactor ldap_handler
Split it into several files, move them into the domain folder, introduce `LdapError` for better control flow.
This commit is contained in:
committed by
nitnelave
parent
0be440efc8
commit
35aa656677
17
server/src/domain/ldap/error.rs
Normal file
17
server/src/domain/ldap/error.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
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>;
|
||||
Reference in New Issue
Block a user