mirror of
https://github.com/chatmail/core.git
synced 2026-04-02 05:22:14 +03:00
add a macro that sends out DC_EVENT_ERROR_NETWORK and takes an Error as parameter. DC_EVENT_ERROR_NETWORK errors may be handled differently in the uis
This commit is contained in:
11
src/log.rs
11
src/log.rs
@@ -41,6 +41,17 @@ macro_rules! error {
|
||||
}};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! error_network {
|
||||
($ctx:expr, $msg:expr) => {
|
||||
error_network!($ctx, $msg,)
|
||||
};
|
||||
($ctx:expr, $msg:expr, $($args:expr),* $(,)?) => {{
|
||||
let formatted = format!($msg, $($args),*);
|
||||
emit_event!($ctx, $crate::Event::ErrorNetwork(formatted));
|
||||
}};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! emit_event {
|
||||
($ctx:expr, $event:expr) => {
|
||||
|
||||
Reference in New Issue
Block a user