aboutsummaryrefslogtreecommitdiff
path: root/build2/test
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-03-22 00:44:52 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-03-22 00:44:52 +0300
commitadddeca028100355a922cc4e45226ce7f18420c9 (patch)
treee056441415e76531c7b1137264b9238ac8056c05 /build2/test
parent330820504e2f231b9e0255142147e2b7939bce0b (diff)
Make use of throw_generic_error()
Diffstat (limited to 'build2/test')
-rw-r--r--build2/test/script/builtin.cxx12
-rw-r--r--build2/test/script/runner.cxx4
2 files changed, 8 insertions, 8 deletions
diff --git a/build2/test/script/builtin.cxx b/build2/test/script/builtin.cxx
index 5b011e3..6f63551 100644
--- a/build2/test/script/builtin.cxx
+++ b/build2/test/script/builtin.cxx
@@ -307,7 +307,7 @@ namespace build2
try
{
if (try_mkdir (to) == mkdir_status::already_exists)
- throw system_error (EEXIST, system_category ());
+ throw_generic_error (EEXIST);
if (cleanup)
sp.clean ({cleanup_type::always, to}, true);
@@ -628,7 +628,7 @@ namespace build2
sp.clean ({cleanup_type::always, p}, true);
}
else // == mkdir_status::already_exists
- throw system_error (EEXIST, system_category ());
+ throw_generic_error (EEXIST);
}
catch (const system_error& e)
{
@@ -748,7 +748,7 @@ namespace build2
try_rmdir_r (d);
}
else if (try_rmfile (p) == rmfile_status::not_exist && !force)
- throw system_error (ENOENT, system_category ());
+ throw_generic_error (ENOENT);
}
catch (const system_error& e)
{
@@ -848,9 +848,9 @@ namespace build2
rmdir_status s (try_rmdir (p));
if (s == rmdir_status::not_empty)
- throw system_error (ENOTEMPTY, system_category ());
+ throw_generic_error (ENOTEMPTY);
else if (s == rmdir_status::not_exist && !force)
- throw system_error (ENOENT, system_category ());
+ throw_generic_error (ENOENT);
}
catch (const system_error& e)
{
@@ -1304,7 +1304,7 @@ namespace build2
#else
if (_utime (p.string ().c_str (), nullptr) == -1)
#endif
- throw system_error (errno, system_category ());
+ throw_generic_error (errno);
}
else if (!entry_exists (p))
{
diff --git a/build2/test/script/runner.cxx b/build2/test/script/runner.cxx
index 464c1f9..3c5f8ba 100644
--- a/build2/test/script/runner.cxx
+++ b/build2/test/script/runner.cxx
@@ -1171,7 +1171,7 @@ namespace build2
if (ifd.get () == -1) // @@ TMP
throw io_error (
- error_code (errno, system_category ()).message ());
+ error_code (errno, generic_category ()).message ());
}
catch (const io_error& e)
{
@@ -1296,7 +1296,7 @@ namespace build2
if (fd.get () == -1) // @@ TMP
throw io_error (
- error_code (errno, system_category ()).message ());
+ error_code (errno, generic_category ()).message ());
}
catch (const io_error& e)
{