mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 06:19:44 +00:00
chore: moving to color_eyre
This commit is contained in:
committed by
Aiden McClelland
parent
36bae894a9
commit
81164f974f
@@ -1,5 +1,5 @@
|
||||
use anyhow::anyhow;
|
||||
use basic_cookies::Cookie;
|
||||
use color_eyre::eyre::eyre;
|
||||
use digest::Digest;
|
||||
use futures::future::BoxFuture;
|
||||
use futures::{FutureExt, TryFutureExt};
|
||||
@@ -29,7 +29,7 @@ pub fn get_id(req: &RequestParts) -> Result<String, Error> {
|
||||
}
|
||||
}
|
||||
Err(Error::new(
|
||||
anyhow!("UNAUTHORIZED"),
|
||||
eyre!("UNAUTHORIZED"),
|
||||
crate::ErrorKind::Authorization,
|
||||
))
|
||||
}
|
||||
@@ -50,7 +50,7 @@ pub async fn is_authed(ctx: &RpcContext, id: &str) -> Result<(), Error> {
|
||||
.await?;
|
||||
if session.rows_affected() == 0 {
|
||||
return Err(Error::new(
|
||||
anyhow!("UNAUTHORIZED"),
|
||||
eyre!("UNAUTHORIZED"),
|
||||
crate::ErrorKind::Authorization,
|
||||
));
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ pub async fn diagnostic<M: Metadata>(
|
||||
if let Err(e) = rpc_res {
|
||||
if e.code == -32601 {
|
||||
*e = Error::new(
|
||||
anyhow::anyhow!(
|
||||
color_eyre::eyre::eyre!(
|
||||
"{} is not available on the Diagnostic API",
|
||||
method
|
||||
),
|
||||
|
||||
@@ -3,7 +3,7 @@ use std::sync::Arc;
|
||||
|
||||
use aes::cipher::{CipherKey, NewCipher, Nonce, StreamCipher};
|
||||
use aes::Aes256Ctr;
|
||||
use anyhow::anyhow;
|
||||
use color_eyre::eyre::eyre;
|
||||
use futures::future::BoxFuture;
|
||||
use futures::{FutureExt, Stream};
|
||||
use hmac::Hmac;
|
||||
@@ -193,7 +193,7 @@ pub fn encrypt<
|
||||
&req.headers,
|
||||
res_parts,
|
||||
Err(Error::new(
|
||||
anyhow!("Must be encrypted"),
|
||||
eyre!("Must be encrypted"),
|
||||
crate::ErrorKind::Authorization,
|
||||
)
|
||||
.into()),
|
||||
|
||||
Reference in New Issue
Block a user