From adddeca028100355a922cc4e45226ce7f18420c9 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 22 Mar 2017 00:44:52 +0300 Subject: Make use of throw_generic_error() --- build2/test/script/builtin.cxx | 12 ++++++------ build2/test/script/runner.cxx | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'build2/test') 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) { -- cgit v1.1