Skip to content

Commit

Permalink
implement Matti suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
nhduongvn committed Mar 14, 2023
1 parent f777646 commit 2621415
Showing 1 changed file with 20 additions and 25 deletions.
45 changes: 20 additions & 25 deletions FWCore/Catalog/src/InputFileCatalog.cc
Expand Up @@ -57,12 +57,11 @@ namespace edm {
throw ex;
}

edm::CatalogAttributes inputOverride_struct(
tmps[0],
tmps[1],
tmps[2],
tmps[3],
tmps[4]); //current-site,current-subSite,desired-data-access-site,desired-data-access-volume,desired-data-access-protocol
edm::CatalogAttributes inputOverride_struct(tmps[0], //current-site
tmps[1], //current-subSite
tmps[2], //desired-data-access-site
tmps[3], //desired-data-access-volume
tmps[4]); //desired-data-access-protocol

overrideFileLocator_ =
std::make_unique<FileLocator>(inputOverride_struct); // propagate_const<T> has no reset() function
Expand All @@ -87,18 +86,16 @@ namespace edm {
fileLocators_trivalCatalog_.push_back(std::make_unique<FileLocator>(*it));
} catch (cms::Exception const& e) {
edm::LogWarning("InputFileCatalog")
<< "Catch an exception while constructing a file locator in InputFileCatalog::init: " << e.what();
if (it != tmp_dataCatalogs.end() - 1) {
std::cout << "\n Skip this catalog" << std::endl;
continue;
} else {
cms::Exception ex("FileCatalog");
ex << "Can not construct a file locator in InputFileCatalog::init";
ex.addContext("Calling edm::InputFileCatalog::init()");
throw ex;
}
<< "Caught an exception while constructing a file locator in InputFileCatalog::init: " << e.what()
<< "Skip this catalog";
}
}
if (fileLocators_trivalCatalog_.empty()) {
cms::Exception ex("FileCatalog");
ex << "Unable to construct any file locator in InputFileCatalog::init";
ex.addContext("Calling edm::InputFileCatalog::init()");
throw ex;
}
} else if (catType == edm::CatalogType::RucioCatalog) {
std::vector<edm::CatalogAttributes> const& tmp_dataCatalogs = localconfservice->dataCatalogs();
if (!fileLocators_.empty())
Expand All @@ -109,18 +106,16 @@ namespace edm {
fileLocators_.push_back(std::make_unique<FileLocator>(*it));
} catch (cms::Exception const& e) {
edm::LogWarning("InputFileCatalog")
<< "Catch an exception while constructing a file locator in InputFileCatalog::init: " << e.what()
<< "Caught an exception while constructing a file locator in InputFileCatalog::init: " << e.what()
<< "Skip this catalog";
if (it != tmp_dataCatalogs.end() - 1) {
continue;
} else {
cms::Exception ex("FileCatalog");
ex << "Can not construct a file locator in InputFileCatalog::init";
ex.addContext("Calling edm::InputFileCatalog::init()");
throw ex;
}
}
}
if (fileLocators_.empty()) {
cms::Exception ex("FileCatalog");
ex << "Unable to construct any file locator in InputFileCatalog::init";
ex.addContext("Calling edm::InputFileCatalog::init()");
throw ex;
}
} else {
cms::Exception ex("FileCatalog");
ex << "Undefined catalog type";
Expand Down

0 comments on commit 2621415

Please sign in to comment.