From d1b62e3338a48015ab1a5f7bb68e13f09b42ea52 Mon Sep 17 00:00:00 2001 From: Shubhranshu Sanjeev Date: Wed, 23 Oct 2024 16:08:42 +0530 Subject: [PATCH] refactor: moved feature specific imports under cfg --- crates/superposition_types/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/superposition_types/src/lib.rs b/crates/superposition_types/src/lib.rs index 882eb75b..aed0905a 100644 --- a/crates/superposition_types/src/lib.rs +++ b/crates/superposition_types/src/lib.rs @@ -72,9 +72,9 @@ impl FromRequest for User { if let Some(user) = req.extensions().get::() { ready(Ok(user.to_owned())) } else { - error!("No user was found while validating token"); - ready(Err(error::ErrorUnauthorized( - json!({"message":"invalid token provided"}), + log::error!("No user was found while validating token"); + ready(Err(actix_web::error::ErrorUnauthorized( + serde_json::json!({"message":"invalid token provided"}), ))) } } @@ -173,7 +173,7 @@ impl FromRequest for TenantConfig { ) -> Self::Future { let result = req.extensions().get::().cloned().ok_or_else(|| { log::error!("Tenant config not found"); - error::ErrorInternalServerError("Tenant config not found") + actix_web::error::ErrorInternalServerError("Tenant config not found") }); ready(result)