Skip to content

Commit 7a60c30

Browse files
committed
Bugfix: skip skipped compoments
1 parent cadacad commit 7a60c30

3 files changed

Lines changed: 22 additions & 12 deletions

File tree

src/Mesh.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,7 @@ void Mesh::read()
632632
<< "' and will skip it due to read error:\n"
633633
<< err.what() << std::endl;
634634
map.forget(component);
635+
continue;
635636
}
636637
homogenizeExtents.check_extent(*this, rc);
637638
}
@@ -660,6 +661,7 @@ void Mesh::read()
660661
<< "' and will skip it due to read error:\n"
661662
<< err.what() << std::endl;
662663
map.forget(component);
664+
continue;
663665
}
664666
homogenizeExtents.check_extent(*this, rc);
665667
}

src/ParticleSpecies.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ void ParticleSpecies::read()
9898
<< err.what() << std::endl;
9999

100100
map.forget(record_name);
101+
continue;
101102
}
102103
homogenizeExtents.merge(*this, std::move(recordExtents));
103104
}
@@ -143,6 +144,7 @@ void ParticleSpecies::read()
143144
map.forget(record_name);
144145
//(*this)[record_name].erase(RecordComponent::SCALAR);
145146
// this->erase(record_name);
147+
continue;
146148
}
147149
homogenizeExtents.merge(*this, std::move(recordExtents));
148150
}

src/Record.cpp

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,18 +117,22 @@ auto Record::read() -> internal::HomogenizeExtents
117117
};
118118
if (scalar())
119119
{
120-
/* using operator[] will incorrectly update parent */
121-
try
122-
{
123-
T_RecordComponent::read(/* require_unit_si = */ true);
124-
}
125-
catch (error::ReadError const &err)
126-
{
127-
std::cerr << "Cannot read scalar record component and will skip it "
128-
"due to read error:\n"
129-
<< err.what() << std::endl;
130-
}
131-
check_extent(*this);
120+
[&]() {
121+
/* using operator[] will incorrectly update parent */
122+
try
123+
{
124+
T_RecordComponent::read(/* require_unit_si = */ true);
125+
}
126+
catch (error::ReadError const &err)
127+
{
128+
std::cerr
129+
<< "Cannot read scalar record component and will skip it "
130+
"due to read error:\n"
131+
<< err.what() << std::endl;
132+
return; // from lambda
133+
}
134+
check_extent(*this);
135+
}();
132136
}
133137
else
134138
{
@@ -153,6 +157,7 @@ auto Record::read() -> internal::HomogenizeExtents
153157
<< "' and will skip it due to read error:\n"
154158
<< err.what() << std::endl;
155159
this->container().erase(component);
160+
continue;
156161
}
157162
check_extent(rc);
158163
}
@@ -181,6 +186,7 @@ auto Record::read() -> internal::HomogenizeExtents
181186
<< "' and will skip it due to read error:\n"
182187
<< err.what() << std::endl;
183188
this->container().erase(component);
189+
continue;
184190
}
185191
check_extent(rc);
186192
}

0 commit comments

Comments
 (0)