Use a Regex in insta dynamic redaction to replace Uuids with [uuid]

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
This commit is contained in:
Martin Tzvetanov Grigorov 2025-05-26 13:39:15 +03:00
parent ce9c930d10
commit f3d691667d
No known key found for this signature in database
GPG key ID: 3194FD8C1AE300EF
2 changed files with 9 additions and 12 deletions

View file

@ -126,7 +126,7 @@ pub enum Error {
#[error(transparent)]
Heed(#[from] heed::Error),
#[error("{}", match .index_uid {
Some(uid) if !uid.is_empty() => format!("Index `{}`: {error}", Error::index_name(uid)),
Some(uid) if !uid.is_empty() => format!("Index `{}`: {error}", uid),
_ => format!("{error}")
})]
Milli { error: milli::Error, index_uid: Option<String> },
@ -177,17 +177,6 @@ pub enum Error {
PlannedFailure,
}
impl Error {
#[inline]
fn index_name(index_name: &str) -> &str {
if uuid::Uuid::parse_str(index_name).is_ok() {
"[uuid]"
} else {
index_name
}
}
}
#[derive(Debug, thiserror::Error)]
#[error(
"{disabled_action} requires enabling the `{feature}` experimental feature. See {issue_link}"