diagnostic mode changes

This commit is contained in:
Aiden McClelland
2021-09-15 12:03:29 -06:00
committed by Aiden McClelland
parent 5154fcf9da
commit 6b4909750c
12 changed files with 78 additions and 61 deletions

View File

@@ -7,7 +7,7 @@ use rpc_toolkit::Metadata;
use crate::Error;
pub async fn recovery<M: Metadata>(
pub async fn diagnostic<M: Metadata>(
_req: &mut Request<Body>,
_metadata: M,
) -> Result<Result<DynMiddlewareStage2, Response<Body>>, HttpError> {
@@ -19,8 +19,11 @@ pub async fn recovery<M: Metadata>(
if let Err(e) = rpc_res {
if e.code == -32601 {
*e = Error::new(
anyhow::anyhow!("{} is not available on the Recovery API", method),
crate::ErrorKind::RecoveryMode,
anyhow::anyhow!(
"{} is not available on the Diagnostic API",
method
),
crate::ErrorKind::DiagnosticMode,
)
.into();
}

View File

@@ -1,4 +1,4 @@
pub mod auth;
pub mod cors;
pub mod diagnostic;
pub mod encrypt;
pub mod recovery;