From 5db146ef751507efd4f9556c9a0ab3bb5e88f7c5 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 6 Jan 2017 03:23:20 +0300 Subject: Make use of operator<<(ostream, exception) --- load/load.cxx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'load/load.cxx') diff --git a/load/load.cxx b/load/load.cxx index b2c19f3..ee258fa 100644 --- a/load/load.cxx +++ b/load/load.cxx @@ -233,7 +233,7 @@ load_repositories (path p) } catch (const io_error& e) { - cerr << "error: unable to read " << p << ": " << e.what () << endl; + cerr << "error: unable to read " << p << ": " << e << endl; throw failed (); } @@ -298,8 +298,7 @@ repository_info (const options& lo, const string& rl, const cstrings& options) } catch (const process_error& e) { - cerr << "error: unable to execute " << args[0] << ": " << e.what () - << endl; + cerr << "error: unable to execute " << args[0] << ": " << e << endl; if (e.child ()) exit (1); @@ -337,7 +336,7 @@ load_packages (const shared_ptr& rp, database& db) } catch (const io_error& e) { - cerr << "error: unable to read " << p << ": " << e.what () << endl; + cerr << "error: unable to read " << p << ": " << e << endl; throw failed (); } @@ -493,7 +492,7 @@ load_repositories (const shared_ptr& rp, database& db) } catch (const io_error& e) { - cerr << "error: unable to read " << p << ": " << e.what () << endl; + cerr << "error: unable to read " << p << ": " << e << endl; throw failed (); } @@ -938,7 +937,7 @@ certificate_info (const options& lo, catch (const process_error& e) { cerr << "error: unable to fetch certificate information for " - << rl.canonical_name () << ": " << e.what () << endl; + << rl.canonical_name () << ": " << e << endl; // Fall through. } @@ -1094,7 +1093,7 @@ catch (const database_locked&) } catch (const recoverable& e) { - cerr << "database recoverable error: " << e.what () << endl; + cerr << "database recoverable error: " << e << endl; return 3; } catch (const cli::exception& e) @@ -1110,6 +1109,6 @@ catch (const failed&) // catch (const std::exception& e) { - cerr << "error: " << e.what () << endl; + cerr << "error: " << e << endl; return 1; } -- cgit v1.1