Skip to content

Commit 0001279

Browse files
committed
fix(Exception): handle exceptions in async context
1 parent cfaece0 commit 0001279

7 files changed

+28
-7
lines changed

src/bin/geode-inspector-brep.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,10 @@ void inspect_brep( const geode::BRep& brep )
293293
nb, " components with non manifold model edges." );
294294
} ) );
295295
}
296-
async::when_all( tasks.begin(), tasks.end() ).wait();
296+
for( auto& task : async::when_all( tasks.begin(), tasks.end() ).get() )
297+
{
298+
task.get();
299+
}
297300
}
298301

299302
int main( int argc, char* argv[] )

src/bin/geode-inspector-cross-section.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,10 @@ void inspect_cross_section( const geode::CrossSection& cross_section )
166166
" unique vertices part of surfaces with invalid topology." );
167167
} ) );
168168
}
169-
async::when_all( tasks.begin(), tasks.end() ).wait();
169+
for( auto& task : async::when_all( tasks.begin(), tasks.end() ).get() )
170+
{
171+
task.get();
172+
}
170173
}
171174

172175
int main( int argc, char* argv[] )

src/bin/geode-inspector-edgedcurve.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ void inspect_edgedcurve( const geode::EdgedCurve< dimension >& edgedcurve )
7373
geode::Logger::info( nb, " degenerated edges" );
7474
} ) );
7575
}
76-
async::when_all( tasks.begin(), tasks.end() ).wait();
76+
for( auto& task : async::when_all( tasks.begin(), tasks.end() ).get() )
77+
{
78+
task.get();
79+
}
7780
}
7881

7982
int main( int argc, char* argv[] )

src/bin/geode-inspector-section.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,10 @@ void inspect_section( const geode::Section& section )
236236
nb, " components with non manifold edges in their mesh." );
237237
} ) );
238238
}
239-
async::when_all( tasks.begin(), tasks.end() ).wait();
239+
for( auto& task : async::when_all( tasks.begin(), tasks.end() ).get() )
240+
{
241+
task.get();
242+
}
240243
}
241244

242245
int main( int argc, char* argv[] )

src/bin/geode-inspector-solid.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ void inspect_solid( const geode::SolidMesh< dimension >& solid )
102102
geode::Logger::info( nb, " non manifold facets" );
103103
} ) );
104104
}
105-
async::when_all( tasks.begin(), tasks.end() ).wait();
105+
for( auto& task : async::when_all( tasks.begin(), tasks.end() ).get() )
106+
{
107+
task.get();
108+
}
106109
}
107110

108111
int main( int argc, char* argv[] )

src/bin/geode-inspector-structural-model.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,10 @@ void inspect_model( const geode::StructuralModel& model )
311311
nb, " components with non manifold model edges." );
312312
} ) );
313313
}
314-
async::when_all( tasks.begin(), tasks.end() ).wait();
314+
for( auto& task : async::when_all( tasks.begin(), tasks.end() ).get() )
315+
{
316+
task.get();
317+
}
315318
}
316319

317320
int main( int argc, char* argv[] )

src/bin/geode-inspector-surface.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ void inspect_surface( const geode::SurfaceMesh< dimension >& surface )
101101
geode::Logger::info( nb, " non manifold edges" );
102102
} ) );
103103
}
104-
async::when_all( tasks.begin(), tasks.end() ).wait();
104+
for( auto& task : async::when_all( tasks.begin(), tasks.end() ).get() )
105+
{
106+
task.get();
107+
}
105108
}
106109

107110
int main( int argc, char* argv[] )

0 commit comments

Comments
 (0)