MCPcopy Create free account
hub / github.com/boostorg/filesystem / throws_fs_error

Function throws_fs_error

test/operations_test.cpp:201–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199
200template< typename F >
201bool throws_fs_error(F func, errno_t en, int line)
202{
203 try
204 {
205 func();
206 }
207 catch (const fs::filesystem_error& ex)
208 {
209 if (report_throws)
210 {
211 // use the what() convenience function to display exceptions
212 cout << "\n"
213 << ex.what() << "\n";
214 }
215 if (en == 0 || en == ex.code().default_error_condition().value())
216 return true;
217 cout
218 << "\nWarning: line " << line
219 << " exception reports default_error_condition().value() "
220 << ex.code().default_error_condition().value()
221 << ", should be " << en
222 << "\n value() is " << ex.code().value()
223 << endl;
224 return true;
225 }
226 return false;
227}
228
229struct poison_category_impl : public boost::system::error_category
230{

Callers

nothing calls this directly

Calls 2

funcFunction · 0.85
whatMethod · 0.80

Tested by

no test coverage detected