diff --git a/clickhouse-admin/src/context.rs b/clickhouse-admin/src/context.rs index aca948614c..96f5a18f07 100644 --- a/clickhouse-admin/src/context.rs +++ b/clickhouse-admin/src/context.rs @@ -12,9 +12,8 @@ use clickhouse_admin_types::{ CLICKHOUSE_KEEPER_CONFIG_FILE, CLICKHOUSE_SERVER_CONFIG_DIR, CLICKHOUSE_SERVER_CONFIG_FILE, }; -use dropshot::HttpError; +use dropshot::{ClientErrorStatusCode, HttpError}; use flume::{Receiver, Sender, TrySendError}; -use http::StatusCode; use illumos_utils::svcadm::Svcadm; use omicron_common::address::CLICKHOUSE_TCP_PORT; use omicron_common::api::external::Generation; @@ -340,7 +339,7 @@ fn generate_config_and_enable_svc( if current > incoming_generation { return Err(HttpError::for_client_error( Some(String::from("Conflict")), - StatusCode::CONFLICT, + ClientErrorStatusCode::CONFLICT, format!( "current generation '{}' is greater than incoming generation '{}'", current, diff --git a/clickhouse-admin/src/http_entrypoints.rs b/clickhouse-admin/src/http_entrypoints.rs index 754266d402..15d025c17b 100644 --- a/clickhouse-admin/src/http_entrypoints.rs +++ b/clickhouse-admin/src/http_entrypoints.rs @@ -11,10 +11,10 @@ use clickhouse_admin_types::{ SystemTimeSeriesSettings, TimeSeriesSettingsQuery, }; use dropshot::{ - ApiDescription, HttpError, HttpResponseCreated, HttpResponseOk, - HttpResponseUpdatedNoContent, Path, Query, RequestContext, TypedBody, + ApiDescription, ClientErrorStatusCode, HttpError, HttpResponseCreated, + HttpResponseOk, HttpResponseUpdatedNoContent, Path, Query, RequestContext, + TypedBody, }; -use http::StatusCode; use omicron_common::api::external::Generation; use std::sync::Arc; @@ -59,7 +59,7 @@ impl ClickhouseAdminServerApi for ClickhouseAdminServerImpl { None => { return Err(HttpError::for_client_error( Some(String::from("ObjectNotFound")), - StatusCode::NOT_FOUND, + ClientErrorStatusCode::NOT_FOUND, "no generation number found".to_string(), )) } @@ -125,7 +125,7 @@ impl ClickhouseAdminKeeperApi for ClickhouseAdminKeeperImpl { None => { return Err(HttpError::for_client_error( Some(String::from("ObjectNotFound")), - StatusCode::NOT_FOUND, + ClientErrorStatusCode::NOT_FOUND, "no generation number found".to_string(), )) }