@@ -411,20 +411,20 @@ Status InMemoryCatalog::DropTable(const TableIdentifier& identifier, bool purge)
411411Result<std::shared_ptr<Table>> InMemoryCatalog::LoadTable (
412412 const TableIdentifier& identifier) {
413413 if (!file_io_) [[unlikely]] {
414- return NotSupported (" file_io is not set for catalog {}" , catalog_name_);
414+ return InvalidArgument (" file_io is not set for catalog {}" , catalog_name_);
415415 }
416416
417417 Result<std::string> metadata_location;
418418 {
419419 std::unique_lock lock (mutex_);
420- metadata_location = root_namespace_-> GetTableMetadataLocation (identifier);
421- ICEBERG_RETURN_UNEXPECTED (metadata_location );
420+ ICEBERG_ASSIGN_OR_RAISE (metadata_location,
421+ root_namespace_-> GetTableMetadataLocation (identifier) );
422422 }
423423
424- auto metadata = TableMetadataUtil::Read (*file_io_, metadata_location. value ());
425- ICEBERG_RETURN_UNEXPECTED (metadata );
424+ ICEBERG_ASSIGN_OR_RAISE ( auto metadata,
425+ TableMetadataUtil::Read (*file_io_, metadata_location. value ()) );
426426
427- return std::make_shared<Table>(identifier, std::move (metadata. value () ),
427+ return std::make_shared<Table>(identifier, std::move (metadata),
428428 metadata_location.value (), file_io_,
429429 std::static_pointer_cast<Catalog>(shared_from_this ()));
430430}
0 commit comments