systemprompt_models/api/errors/
config_plane.rs1use systemprompt_provider_contracts::ConfigPlaneError;
11
12use super::ApiError;
13
14const PLANE_FAILURE: &str = "Config plane operation failed";
15
16impl From<ConfigPlaneError> for ApiError {
17 fn from(err: ConfigPlaneError) -> Self {
18 match err {
19 ConfigPlaneError::FileManaged { .. } => {
20 Self::conflict(err.to_string()).with_error_key("config_plane_file_managed")
21 },
22 ConfigPlaneError::UnknownPlane(_) => Self::not_found(err.to_string()),
23 ConfigPlaneError::Invalid { .. } => Self::bad_request(err.to_string()),
24 other => Self::internal(PLANE_FAILURE, other),
25 }
26 }
27}