clippy pleaser
This commit is contained in:
@@ -84,7 +84,7 @@ pub async fn alert_history(
|
|||||||
ApiError::new(
|
ApiError::new(
|
||||||
StatusCode::INTERNAL_SERVER_ERROR,
|
StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
"alert_history_failed",
|
"alert_history_failed",
|
||||||
&err.to_string(),
|
err.to_string(),
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
@@ -185,7 +185,7 @@ async fn evaluate_alerts(
|
|||||||
ApiError::new(
|
ApiError::new(
|
||||||
StatusCode::INTERNAL_SERVER_ERROR,
|
StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
"alerts_query_failed",
|
"alerts_query_failed",
|
||||||
&err.to_string(),
|
err.to_string(),
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
@@ -204,7 +204,7 @@ async fn evaluate_alerts(
|
|||||||
ApiError::new(
|
ApiError::new(
|
||||||
StatusCode::INTERNAL_SERVER_ERROR,
|
StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
"alerts_query_failed",
|
"alerts_query_failed",
|
||||||
&err.to_string(),
|
err.to_string(),
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
@@ -223,7 +223,7 @@ async fn evaluate_alerts(
|
|||||||
ApiError::new(
|
ApiError::new(
|
||||||
StatusCode::INTERNAL_SERVER_ERROR,
|
StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
"alerts_query_failed",
|
"alerts_query_failed",
|
||||||
&err.to_string(),
|
err.to_string(),
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ pub async fn list_audit_events(
|
|||||||
Err(ApiError::new(
|
Err(ApiError::new(
|
||||||
StatusCode::INTERNAL_SERVER_ERROR,
|
StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
"list_audit_events_failed",
|
"list_audit_events_failed",
|
||||||
&err.to_string(),
|
err.to_string(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ pub async fn relay_agent_command(
|
|||||||
return Err(ApiError::new(
|
return Err(ApiError::new(
|
||||||
StatusCode::BAD_GATEWAY,
|
StatusCode::BAD_GATEWAY,
|
||||||
"agent_send_failed",
|
"agent_send_failed",
|
||||||
&format!("failed to send command to agent: {err}"),
|
format!("failed to send command to agent: {err}"),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ pub async fn create_known_device(
|
|||||||
Err(ApiError::new(
|
Err(ApiError::new(
|
||||||
StatusCode::BAD_REQUEST,
|
StatusCode::BAD_REQUEST,
|
||||||
"create_known_device_failed",
|
"create_known_device_failed",
|
||||||
&err.to_string(),
|
err.to_string(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -105,7 +105,7 @@ pub async fn list_known_devices(
|
|||||||
Err(ApiError::new(
|
Err(ApiError::new(
|
||||||
StatusCode::INTERNAL_SERVER_ERROR,
|
StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
"list_known_devices_failed",
|
"list_known_devices_failed",
|
||||||
&err.to_string(),
|
err.to_string(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -128,7 +128,7 @@ pub async fn forget_known_device(
|
|||||||
Err(ApiError::new(
|
Err(ApiError::new(
|
||||||
StatusCode::INTERNAL_SERVER_ERROR,
|
StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
"forget_known_device_failed",
|
"forget_known_device_failed",
|
||||||
&err.to_string(),
|
err.to_string(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -160,7 +160,7 @@ pub async fn attach_device_identifier(
|
|||||||
Err(ApiError::new(
|
Err(ApiError::new(
|
||||||
StatusCode::BAD_REQUEST,
|
StatusCode::BAD_REQUEST,
|
||||||
"attach_device_identifier_failed",
|
"attach_device_identifier_failed",
|
||||||
&err.to_string(),
|
err.to_string(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -186,7 +186,7 @@ pub async fn detach_device_identifier(
|
|||||||
Err(ApiError::new(
|
Err(ApiError::new(
|
||||||
StatusCode::BAD_REQUEST,
|
StatusCode::BAD_REQUEST,
|
||||||
"detach_device_identifier_failed",
|
"detach_device_identifier_failed",
|
||||||
&err.to_string(),
|
err.to_string(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -213,7 +213,7 @@ pub async fn merge_known_device(
|
|||||||
Err(ApiError::new(
|
Err(ApiError::new(
|
||||||
StatusCode::BAD_REQUEST,
|
StatusCode::BAD_REQUEST,
|
||||||
"merge_known_device_failed",
|
"merge_known_device_failed",
|
||||||
&err.to_string(),
|
err.to_string(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ pub async fn enroll(
|
|||||||
Err(ApiError::new(
|
Err(ApiError::new(
|
||||||
StatusCode::UNAUTHORIZED,
|
StatusCode::UNAUTHORIZED,
|
||||||
"enrollment_rejected",
|
"enrollment_rejected",
|
||||||
&err.to_string(),
|
err.to_string(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -178,7 +178,7 @@ pub async fn issue_enroll_token(
|
|||||||
Err(ApiError::new(
|
Err(ApiError::new(
|
||||||
StatusCode::INTERNAL_SERVER_ERROR,
|
StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
"issue_enroll_token_failed",
|
"issue_enroll_token_failed",
|
||||||
&err.to_string(),
|
err.to_string(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -223,7 +223,7 @@ pub async fn list_enroll_tokens(
|
|||||||
Err(ApiError::new(
|
Err(ApiError::new(
|
||||||
StatusCode::INTERNAL_SERVER_ERROR,
|
StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
"list_enroll_tokens_failed",
|
"list_enroll_tokens_failed",
|
||||||
&err.to_string(),
|
err.to_string(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -270,7 +270,7 @@ pub async fn revoke_enroll_token(
|
|||||||
Err(ApiError::new(
|
Err(ApiError::new(
|
||||||
StatusCode::INTERNAL_SERVER_ERROR,
|
StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
"revoke_enroll_token_failed",
|
"revoke_enroll_token_failed",
|
||||||
&err.to_string(),
|
err.to_string(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -325,7 +325,7 @@ pub async fn revoke_agent(
|
|||||||
Err(ApiError::new(
|
Err(ApiError::new(
|
||||||
StatusCode::INTERNAL_SERVER_ERROR,
|
StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
"revoke_agent_failed",
|
"revoke_agent_failed",
|
||||||
&err.to_string(),
|
err.to_string(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -392,7 +392,7 @@ pub async fn set_agent_nickname(
|
|||||||
Err(ApiError::new(
|
Err(ApiError::new(
|
||||||
StatusCode::INTERNAL_SERVER_ERROR,
|
StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
"set_agent_nickname_failed",
|
"set_agent_nickname_failed",
|
||||||
&err.to_string(),
|
err.to_string(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ pub async fn list_fleet_devices(
|
|||||||
Err(ApiError::new(
|
Err(ApiError::new(
|
||||||
StatusCode::INTERNAL_SERVER_ERROR,
|
StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
"list_fleet_devices_failed",
|
"list_fleet_devices_failed",
|
||||||
&err.to_string(),
|
err.to_string(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -166,7 +166,7 @@ pub async fn wake_fleet_device(
|
|||||||
ApiError::new(
|
ApiError::new(
|
||||||
StatusCode::INTERNAL_SERVER_ERROR,
|
StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
"load_fleet_devices_failed",
|
"load_fleet_devices_failed",
|
||||||
&err.to_string(),
|
err.to_string(),
|
||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ pub async fn state_stats(State(state): State<AppState>) -> Result<impl IntoRespo
|
|||||||
Err(ApiError::new(
|
Err(ApiError::new(
|
||||||
StatusCode::INTERNAL_SERVER_ERROR,
|
StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
"state_stats_failed",
|
"state_stats_failed",
|
||||||
&err.to_string(),
|
err.to_string(),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ impl ApiError {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
pub fn with_details(mut self, details: serde_json::Value) -> Self {
|
pub fn with_details(mut self, details: serde_json::Value) -> Self {
|
||||||
self.details = Some(details);
|
self.details = Some(details);
|
||||||
self
|
self
|
||||||
|
|||||||
Reference in New Issue
Block a user