elaborate error macro and apply at various callsites
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
b3f2288d07
commit
05efd9b044
23 changed files with 161 additions and 140 deletions
|
@ -6,7 +6,7 @@ mod sender;
|
|||
|
||||
use std::fmt::Debug;
|
||||
|
||||
use conduit::{Error, Result};
|
||||
use conduit::{err, Result};
|
||||
pub use resolve::{resolve_actual_dest, CachedDest, CachedOverride, FedDest};
|
||||
use ruma::{
|
||||
api::{appservice::Registration, OutgoingRequest},
|
||||
|
@ -224,7 +224,7 @@ impl Service {
|
|||
fn dispatch(&self, msg: Msg) -> Result<()> {
|
||||
debug_assert!(!self.sender.is_full(), "channel full");
|
||||
debug_assert!(!self.sender.is_closed(), "channel closed");
|
||||
self.sender.send(msg).map_err(|e| Error::Err(e.to_string()))
|
||||
self.sender.send(msg).map_err(|e| err!("{e}"))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,13 +5,12 @@ use std::{
|
|||
time::SystemTime,
|
||||
};
|
||||
|
||||
use conduit::Err;
|
||||
use conduit::{debug, debug_error, debug_info, debug_warn, trace, utils::rand, Err, Error, Result};
|
||||
use hickory_resolver::{error::ResolveError, lookup::SrvLookup};
|
||||
use ipaddress::IPAddress;
|
||||
use ruma::{OwnedServerName, ServerName};
|
||||
use tracing::{debug, error, trace};
|
||||
|
||||
use crate::{debug_error, debug_info, debug_warn, services, utils::rand, Error, Result};
|
||||
use crate::services;
|
||||
|
||||
/// Wraps either an literal IP address plus port, or a hostname plus complement
|
||||
/// (colon-plus-port if it was specified).
|
||||
|
@ -346,10 +345,7 @@ fn handle_resolve_error(e: &ResolveError) -> Result<()> {
|
|||
debug!("{e}");
|
||||
Ok(())
|
||||
},
|
||||
_ => {
|
||||
error!("DNS {e}");
|
||||
Err(Error::Err(e.to_string()))
|
||||
},
|
||||
_ => Err!(error!("DNS {e}")),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue