use systemprompt_provider_contracts::ConfigPlaneError;
use super::ApiError;
const PLANE_FAILURE: &str = "Config plane operation failed";
impl From<ConfigPlaneError> for ApiError {
fn from(err: ConfigPlaneError) -> Self {
match err {
ConfigPlaneError::FileManaged { .. } => {
Self::conflict(err.to_string()).with_error_key("config_plane_file_managed")
},
ConfigPlaneError::UnknownPlane(_) => Self::not_found(err.to_string()),
ConfigPlaneError::Invalid { .. } => Self::bad_request(err.to_string()),
other => Self::internal(PLANE_FAILURE, other),
}
}
}