aboutsummaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorDaniel García <[email protected]>2020-02-17 22:56:26 +0100
committerDaniel García <[email protected]>2020-02-17 22:56:26 +0100
commit325039c31695ac981da3b88dbbe6c6f40c6a180d (patch)
treebfb0620ccbe0dafd9344d2ef73783496d5c9599c /src/error.rs
parentc5b97f4146fd387c6845f52bec6d6ee02cc61413 (diff)
downloadvaultwarden-325039c31695ac981da3b88dbbe6c6f40c6a180d.tar.gz
vaultwarden-325039c31695ac981da3b88dbbe6c6f40c6a180d.zip
Attachment size limits, per-user and per-organization
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs
index ab700d70..7cd0bd82 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -212,6 +212,18 @@ macro_rules! err {
}
#[macro_export]
+macro_rules! err_discard {
+ ($msg:expr, $data:expr) => {{
+ std::io::copy(&mut $data.open(), &mut std::io::sink()).ok();
+ return Err(crate::error::Error::new($msg, $msg));
+ }};
+ ($usr_msg:expr, $log_value:expr, $data:expr) => {{
+ std::io::copy(&mut $data.open(), &mut std::io::sink()).ok();
+ return Err(crate::error::Error::new($usr_msg, $log_value));
+ }};
+}
+
+#[macro_export]
macro_rules! err_json {
($expr:expr, $log_value:expr) => {{
return Err(($log_value, $expr).into());