@@ -211,7 +211,7 @@ impl Catalog {
211211 self . catalog_update_with_retry ( || {
212212 let time_ns = self . time_provider . now ( ) . timestamp_nanos ( ) ;
213213 let Some ( node) = self . node ( node_id) else {
214- return Err ( crate :: CatalogError :: NotFound ) ;
214+ return Err ( crate :: CatalogError :: NotFound ( node_id . to_string ( ) ) ) ;
215215 } ;
216216 if !node. is_running ( ) {
217217 return Err ( crate :: CatalogError :: NodeAlreadyStopped {
@@ -259,16 +259,16 @@ impl Catalog {
259259
260260 pub async fn soft_delete_database (
261261 & self ,
262- name : & str ,
262+ db_name : & str ,
263263 hard_delete_time : HardDeletionTime ,
264264 ) -> Result < OrderedCatalogBatch > {
265265 self . catalog_update_with_retry ( || {
266- if name == INTERNAL_DB_NAME {
266+ if db_name == INTERNAL_DB_NAME {
267267 return Err ( CatalogError :: CannotDeleteInternalDatabase ) ;
268268 } ;
269269
270- let Some ( db) = self . db_schema ( name ) else {
271- return Err ( CatalogError :: NotFound ) ;
270+ let Some ( db) = self . db_schema ( db_name ) else {
271+ return Err ( CatalogError :: NotFound ( db_name . to_string ( ) ) ) ;
272272 } ;
273273
274274 // If the request specifies the default hard-delete time, and the schema has an existing hard_delete_time,
@@ -338,10 +338,10 @@ impl Catalog {
338338 ) -> Result < OrderedCatalogBatch > {
339339 self . catalog_update_with_retry ( || {
340340 let Some ( db) = self . db_schema ( db_name) else {
341- return Err ( CatalogError :: NotFound ) ;
341+ return Err ( CatalogError :: NotFound ( db_name . to_string ( ) ) ) ;
342342 } ;
343343 let Some ( tbl_def) = db. table_definition ( table_name) else {
344- return Err ( CatalogError :: NotFound ) ;
344+ return Err ( CatalogError :: NotFound ( table_name . to_string ( ) ) ) ;
345345 } ;
346346
347347 // If the request specifies the default hard-delete time, and the schema has an existing hard_delete_time,
@@ -402,10 +402,10 @@ impl Catalog {
402402 info ! ( ?db_id, ?table_id, "Hard delete table." ) ;
403403 self . catalog_update_with_retry ( || {
404404 let Some ( db) = self . db_schema_by_id ( db_id) else {
405- return Err ( CatalogError :: NotFound ) ;
405+ return Err ( CatalogError :: NotFound ( format ! ( "database id: {}" , db_id ) ) ) ;
406406 } ;
407407 let Some ( _table_def) = db. table_definition_by_id ( table_id) else {
408- return Err ( CatalogError :: NotFound ) ;
408+ return Err ( CatalogError :: NotFound ( format ! ( "table id: {}" , table_id ) ) ) ;
409409 } ;
410410
411411 let deletion_time = self . time_provider . now ( ) . timestamp_nanos ( ) ;
@@ -431,7 +431,7 @@ impl Catalog {
431431 info ! ( ?db_id, "Hard delete database." ) ;
432432 self . catalog_update_with_retry ( || {
433433 let Some ( db) = self . db_schema_by_id ( db_id) else {
434- return Err ( CatalogError :: NotFound ) ;
434+ return Err ( CatalogError :: NotFound ( format ! ( "database id: {}" , db_id ) ) ) ;
435435 } ;
436436
437437 // Prevent deletion of internal database
@@ -461,10 +461,10 @@ impl Catalog {
461461 info ! ( db_name, table_name, cache_name = ?cache_name, "create distinct cache" ) ;
462462 self . catalog_update_with_retry ( || {
463463 let Some ( db) = self . db_schema ( db_name) else {
464- return Err ( CatalogError :: NotFound ) ;
464+ return Err ( CatalogError :: NotFound ( db_name . to_string ( ) ) ) ;
465465 } ;
466466 let Some ( mut tbl) = db. table_definition ( table_name) else {
467- return Err ( CatalogError :: NotFound ) ;
467+ return Err ( CatalogError :: NotFound ( table_name . to_string ( ) ) ) ;
468468 } ;
469469 if columns. is_empty ( ) {
470470 return Err ( CatalogError :: invalid_configuration (
@@ -546,10 +546,10 @@ impl Catalog {
546546 info ! ( db_name, table_name, cache_name = ?cache_name, "create last cache" ) ;
547547 self . catalog_update_with_retry ( || {
548548 let Some ( db) = self . db_schema ( db_name) else {
549- return Err ( CatalogError :: NotFound ) ;
549+ return Err ( CatalogError :: NotFound ( db_name . to_string ( ) ) ) ;
550550 } ;
551551 let Some ( mut tbl) = db. table_definition ( table_name) else {
552- return Err ( CatalogError :: NotFound ) ;
552+ return Err ( CatalogError :: NotFound ( table_name . to_string ( ) ) ) ;
553553 } ;
554554
555555 fn is_valid_last_cache_key_col ( def : & ColumnDefinition ) -> bool {
@@ -667,7 +667,7 @@ impl Catalog {
667667 info ! ( db_name, trigger_name, "create processing engine trigger" ) ;
668668 self . catalog_update_with_retry ( || {
669669 let Some ( mut db) = self . db_schema ( db_name) else {
670- return Err ( CatalogError :: NotFound ) ;
670+ return Err ( CatalogError :: NotFound ( db_name . to_string ( ) ) ) ;
671671 } ;
672672 let trigger = TriggerSpecificationDefinition :: from_string_rep ( trigger_specification) ?;
673673 if db. processing_engine_triggers . contains_name ( trigger_name) {
@@ -709,7 +709,7 @@ impl Catalog {
709709 "create new retention policy"
710710 ) ;
711711 let Some ( db) = self . db_schema ( db_name) else {
712- return Err ( CatalogError :: NotFound ) ;
712+ return Err ( CatalogError :: NotFound ( db_name . to_string ( ) ) ) ;
713713 } ;
714714 self . catalog_update_with_retry ( || {
715715 Ok ( CatalogBatch :: database (
@@ -814,7 +814,7 @@ impl DatabaseCatalogTransaction {
814814 column_type : FieldDataType ,
815815 ) -> Result < ColumnId > {
816816 let Some ( table_def) = self . database_schema . table_definition ( table_name) else {
817- return Err ( CatalogError :: NotFound ) ;
817+ return Err ( CatalogError :: NotFound ( table_name . to_string ( ) ) ) ;
818818 } ;
819819 match table_def. column_definition ( column_name) {
820820 Some ( def) if def. data_type == column_type. into ( ) => Ok ( def. id ) ,
0 commit comments