Skip to content

Commit 7aac6a6

Browse files
committed
chore: split the err msg
1 parent 36e7703 commit 7aac6a6

1 file changed

Lines changed: 28 additions & 16 deletions

File tree

src/query/storages/system/src/indexes_table.rs

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -235,28 +235,40 @@ impl IndexesTable {
235235
continue;
236236
}
237237
}
238-
let result = match (
238+
let tables = match (
239239
table_names,
240240
table_names.iter().len() <= POINT_GET_TABLE_LIMIT,
241241
) {
242242
(Some(table_names), true) => {
243-
try_join_all(
244-
table_names
245-
.iter()
246-
.map(|table_name| db.get_table(table_name)),
247-
)
243+
match try_join_all(table_names.iter().map(|table_name| async {
244+
db.get_table(table_name)
245+
.await
246+
.map_err(|err| (table_name.to_string(), err))
247+
}))
248248
.await
249+
{
250+
Ok(tables) => tables,
251+
Err((table_name, err)) => {
252+
let msg = format!(
253+
"Failed to get table: {} in database: {}, {}",
254+
table_name, db_name, err
255+
);
256+
warn!("{}", msg);
257+
ctx.push_warning(msg);
258+
continue;
259+
}
260+
}
249261
}
250-
_ => catalog.list_tables(&tenant, db_name).await,
251-
};
252-
let tables = match result {
253-
Ok(tables) => tables,
254-
Err(err) => {
255-
let msg = format!("Failed to list tables in database: {}, {}", db_name, err);
256-
warn!("{}", msg);
257-
ctx.push_warning(msg);
258-
continue;
259-
}
262+
_ => match catalog.list_tables(&tenant, db_name).await {
263+
Ok(tables) => tables,
264+
Err(err) => {
265+
let msg =
266+
format!("Failed to list tables in database: {}, {}", db_name, err);
267+
warn!("{}", msg);
268+
ctx.push_warning(msg);
269+
continue;
270+
}
271+
},
260272
};
261273
for table in tables {
262274
let table_info = table.get_table_info();

0 commit comments

Comments
 (0)