bitque/actors/websocket-actor/src/prelude.rs

17 lines
392 B
Rust

#[macro_export]
macro_rules! query_db_or_print {
($s:expr,$msg:expr) => {
match block_on($s.db.send($msg)) {
Ok(Ok(r)) => r,
Ok(Err(e)) => {
log::error!("{:?}", e);
return Ok(None);
}
Err(e) => {
log::error!("{}", e);
return Ok(None);
}
}
};
}