diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2017-01-06 03:24:33 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2017-01-09 21:44:22 +0300 |
commit | 9e2b4fd3bbc0c61bf6c84540c52869ec7d830718 (patch) | |
tree | 550c9edd5b29b164d7c8c2ac13111a9491495022 /build2/test/script/builtin.cxx | |
parent | c5d118cde064c09a416541a7f7e76d354552b2fd (diff) |
Make use of operator<<(ostream, exception)
Diffstat (limited to 'build2/test/script/builtin.cxx')
-rw-r--r-- | build2/test/script/builtin.cxx | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/build2/test/script/builtin.cxx b/build2/test/script/builtin.cxx index 0b99e8f..d00a8a1 100644 --- a/build2/test/script/builtin.cxx +++ b/build2/test/script/builtin.cxx @@ -161,7 +161,7 @@ namespace build2 else cerr << "'" << p << "'"; - cerr << ": " << e.what () << endl; + cerr << ": " << e << endl; throw failed (); } @@ -179,7 +179,7 @@ namespace build2 catch (const io_error& e) { if (cerr.good ()) - cerr << "cat: " << e.what () << endl; + cerr << "cat: " << e << endl; } catch (const failed&) { @@ -222,7 +222,7 @@ namespace build2 } catch (const std::exception& e) { - cerr << "echo: " << e.what () << endl; + cerr << "echo: " << e << endl; } cerr.close (); @@ -338,7 +338,7 @@ namespace build2 catch (const system_error& e) { cerr << "mkdir: unable to create directory '" << p << "': " - << e.what () << endl; + << e << endl; throw failed (); } } @@ -355,7 +355,7 @@ namespace build2 catch (const io_error& e) { if (cerr.good ()) - cerr << "mkdir: " << e.what () << endl; + cerr << "mkdir: " << e << endl; } catch (const failed&) { @@ -478,8 +478,7 @@ namespace build2 } catch (const system_error& e) { - cerr << "rm: unable to remove '" << p << "': " << e.what () - << endl; + cerr << "rm: unable to remove '" << p << "': " << e << endl; throw failed (); } } @@ -496,7 +495,7 @@ namespace build2 catch (const io_error& e) { if (cerr.good ()) - cerr << "rm: " << e.what () << endl; + cerr << "rm: " << e << endl; } catch (const failed&) { @@ -578,8 +577,8 @@ namespace build2 } catch (const io_error& e) { - cerr << "touch: cannot create file '" << p << "': " - << e.what () << endl; + cerr << "touch: cannot create file '" << p << "': " << e + << endl; throw failed (); } @@ -594,8 +593,8 @@ namespace build2 } catch (const system_error& e) { - cerr << "touch: cannot create/update '" << p << "': " - << e.what () << endl; + cerr << "touch: cannot create/update '" << p << "': " << e + << endl; throw failed (); } } @@ -612,7 +611,7 @@ namespace build2 catch (const io_error& e) { if (cerr.good ()) - cerr << "touch: " << e.what () << endl; + cerr << "touch: " << e << endl; } catch (const failed&) { |