|
|
@ -5,7 +5,6 @@ use crate::db::models::EventType; |
|
|
|
use crate::http_client::CustomHttpClientError; |
|
|
|
use std::error::Error as StdError; |
|
|
|
|
|
|
|
#[allow(edition_2024_expr_fragment_specifier)] |
|
|
|
macro_rules! make_error { |
|
|
|
( $( $name:ident ( $ty:ty ): $src_fn:expr, $usr_msg_fun:expr ),+ $(,)? ) => { |
|
|
|
const BAD_REQUEST: u16 = 400; |
|
|
@ -228,7 +227,6 @@ impl Responder<'_, 'static> for Error { |
|
|
|
// Error return macros
|
|
|
|
//
|
|
|
|
#[macro_export] |
|
|
|
#[allow(edition_2024_expr_fragment_specifier)] |
|
|
|
macro_rules! err { |
|
|
|
($msg:expr) => {{ |
|
|
|
error!("{}", $msg); |
|
|
@ -249,7 +247,6 @@ macro_rules! err { |
|
|
|
} |
|
|
|
|
|
|
|
#[macro_export] |
|
|
|
#[allow(edition_2024_expr_fragment_specifier)] |
|
|
|
macro_rules! err_silent { |
|
|
|
($msg:expr) => {{ |
|
|
|
return Err($crate::error::Error::new($msg, $msg)); |
|
|
@ -260,7 +257,6 @@ macro_rules! err_silent { |
|
|
|
} |
|
|
|
|
|
|
|
#[macro_export] |
|
|
|
#[allow(edition_2024_expr_fragment_specifier)] |
|
|
|
macro_rules! err_code { |
|
|
|
($msg:expr, $err_code:expr) => {{ |
|
|
|
error!("{}", $msg); |
|
|
@ -273,7 +269,6 @@ macro_rules! err_code { |
|
|
|
} |
|
|
|
|
|
|
|
#[macro_export] |
|
|
|
#[allow(edition_2024_expr_fragment_specifier)] |
|
|
|
macro_rules! err_discard { |
|
|
|
($msg:expr, $data:expr) => {{ |
|
|
|
std::io::copy(&mut $data.open(), &mut std::io::sink()).ok(); |
|
|
@ -286,7 +281,6 @@ macro_rules! err_discard { |
|
|
|
} |
|
|
|
|
|
|
|
#[macro_export] |
|
|
|
#[allow(edition_2024_expr_fragment_specifier)] |
|
|
|
macro_rules! err_json { |
|
|
|
($expr:expr, $log_value:expr) => {{ |
|
|
|
return Err(($log_value, $expr).into()); |
|
|
@ -297,7 +291,6 @@ macro_rules! err_json { |
|
|
|
} |
|
|
|
|
|
|
|
#[macro_export] |
|
|
|
#[allow(edition_2024_expr_fragment_specifier)] |
|
|
|
macro_rules! err_handler { |
|
|
|
($expr:expr) => {{ |
|
|
|
error!(target: "auth", "Unauthorized Error: {}", $expr); |
|
|
|