diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2016-09-15 17:26:49 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2016-09-15 17:26:49 +0300 |
commit | cdb1a96ce61fd179911ac175d298decba26b5910 (patch) | |
tree | 3cfa97fa7fbb58e88589201589ad253261643e2f | |
parent | cfdb36cc944f2493e0c2248f6e74001bf92d6bc5 (diff) |
Add io_error alias for std::ios_base::failure
-rw-r--r-- | brep/types | 2 | ||||
-rw-r--r-- | load/load.cxx | 10 |
2 files changed, 7 insertions, 5 deletions
@@ -15,6 +15,7 @@ #include <ostream> #include <functional> // function, reference_wrapper +#include <ios> // ios_base::failure #include <exception> // exception #include <stdexcept> // logic_error, invalid_argument, runtime_error #include <system_error> @@ -62,6 +63,7 @@ namespace brep using std::invalid_argument; using std::runtime_error; using std::system_error; + using io_error = std::ios_base::failure; // <butl/optional> // diff --git a/load/load.cxx b/load/load.cxx index 26d4e20..f70abc3 100644 --- a/load/load.cxx +++ b/load/load.cxx @@ -230,7 +230,7 @@ load_repositories (path p) bad_line ("junk after filesystem path"); } } - catch (const ifdstream::failure& e) + catch (const io_error& e) { cerr << "error: unable to read " << p << ": " << e.what () << endl; throw failed (); @@ -334,7 +334,7 @@ load_packages (const shared_ptr<repository>& rp, database& db) manifest_parser mp (ifs, p.string ()); pkm = package_manifests (mp); } - catch (const ifdstream::failure& e) + catch (const io_error& e) { cerr << "error: unable to read " << p << ": " << e.what () << endl; throw failed (); @@ -490,7 +490,7 @@ load_repositories (const shared_ptr<repository>& rp, database& db) manifest_parser mp (ifs, p.string ()); rpm = repository_manifests (mp); } - catch (const ifdstream::failure& e) + catch (const io_error& e) { cerr << "error: unable to read " << p << ": " << e.what () << endl; throw failed (); @@ -908,7 +908,7 @@ certificate_info (const options& lo, // is.exceptions (ifdstream::failbit | ifdstream::badbit); if (is.peek () != ifdstream::traits_type::eof ()) - throw ifdstream::failure (""); + throw io_error (""); is.close (); @@ -918,7 +918,7 @@ certificate_info (const options& lo, // Fall through. // } - catch (const ifdstream::failure&) + catch (const io_error&) { // Child exit status doesn't matter. Just wait for the process // completion and fall through. |