Merge pull request #6776 from influxdata/dom/log-ids

refactor: log IDs in panic messages
pull/24376/head
kodiakhq[bot] 2023-01-31 11:26:19 +00:00 committed by GitHub
commit cb8254e2eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 3 deletions

View File

@ -48,7 +48,12 @@ impl NamespaceNameResolver {
.namespaces()
.get_by_id(namespace_id)
.await?
.expect("resolving namespace name for non-existent namespace id")
.unwrap_or_else(|| {
panic!(
"resolving namespace name for non-existent namespace id {}",
namespace_id
)
})
.name
.into();

View File

@ -40,7 +40,12 @@ impl SortKeyResolver {
.partitions()
.get_by_id(self.partition_id)
.await?
.expect("resolving sort key for non-existent partition")
.unwrap_or_else(|| {
panic!(
"resolving sort key for non-existent partition ID {}",
self.partition_id
)
})
.sort_key();
Result::<_, iox_catalog::interface::Error>::Ok(s)

View File

@ -48,7 +48,12 @@ impl TableNameResolver {
.tables()
.get_by_id(table_id)
.await?
.expect("resolving table name for non-existent table id")
.unwrap_or_else(|| {
panic!(
"resolving table name for non-existent table id {}",
table_id
)
})
.name
.into();