mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-09 13:39:46 -05:00
small readability improvements to web.rs
I think this has a minor behavior change: permission denied replies change to HTTP 403 where they were HTTP 401. The new behavior seems more correct, as these errors can occur when authentication has succeeded but the session in question is not authorized for the given operation. The UI currently doesn't care about this distinction.
This commit is contained in:
@@ -158,10 +158,10 @@ where
|
||||
#[macro_export]
|
||||
macro_rules! bail_t {
|
||||
($t:ident, $e:expr) => {
|
||||
return Err(failure::err_msg($e).context($crate::ErrorKind::$t).into());
|
||||
return Err($crate::Error::from(failure::err_msg($e).context($crate::ErrorKind::$t)).into());
|
||||
};
|
||||
($t:ident, $fmt:expr, $($arg:tt)+) => {
|
||||
return Err(failure::err_msg(format!($fmt, $($arg)+)).context($crate::ErrorKind::$t).into());
|
||||
return Err($crate::Error::from(failure::err_msg(format!($fmt, $($arg)+)).context($crate::ErrorKind::$t)).into());
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user