Skip to content

Commit

Permalink
Merge pull request #42396 from wddgit/fixErrorReturnCode124X
Browse files Browse the repository at this point in the history
Fix error code on fallback file open error with test, 12_4_X backport
  • Loading branch information
cmsbuild authored Aug 22, 2023
2 parents 9cb268b + 881384b commit 88ebdac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions IOPool/Input/src/RootInputFileSequence.cc
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,15 @@ namespace edm {
}
for (std::vector<std::string>::const_iterator it = fNames.begin(); it != fNames.end(); ++it) {
try {
usedFallback_ = (it != fNames.begin());
std::unique_ptr<char[]> name(gSystem->ExpandPathName(it->c_str()));
filePtr = std::make_shared<InputFile>(name.get(), " Initiating request to open file ", inputType);
usedFallback_ = (it != fNames.begin());
break;
} catch (cms::Exception const& e) {
if (!skipBadFiles && std::next(it) == fNames.end()) {
InputFile::reportSkippedFile((*it), logicalFileName());
Exception ex(errors::FileOpenError, "", e);
errors::ErrorCodes errorCode = usedFallback_ ? errors::FallbackFileOpenError : errors::FileOpenError;
Exception ex(errorCode, "", e);
ex.addContext("Calling RootInputFileSequence::initTheFile()");
std::ostringstream out;
out << "Input file " << (*it) << " could not be opened.";
Expand Down

0 comments on commit 88ebdac

Please sign in to comment.