From 9e2b4fd3bbc0c61bf6c84540c52869ec7d830718 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 6 Jan 2017 03:24:33 +0300 Subject: Make use of operator<<(ostream, exception) --- build2/cc/compile.cxx | 4 ++-- build2/cc/gcc.cxx | 2 +- build2/cc/link.cxx | 10 +++++----- build2/cc/module.cxx | 2 +- build2/cc/windows-manifest.cxx | 2 +- build2/cc/windows-rpath.cxx | 8 ++++---- 6 files changed, 14 insertions(+), 14 deletions(-) (limited to 'build2/cc') diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx index 1b34c69..6fd64c2 100644 --- a/build2/cc/compile.cxx +++ b/build2/cc/compile.cxx @@ -1370,7 +1370,7 @@ namespace build2 } catch (const process_error& e) { - error << "unable to execute " << args[0] << ": " << e.what (); + error << "unable to execute " << args[0] << ": " << e; // In a multi-threaded program that fork()'ed but did not exec(), // it is unwise to try to do any kind of cleanup (like unwinding @@ -1596,7 +1596,7 @@ namespace build2 } catch (const process_error& e) { - error << "unable to execute " << args[0] << ": " << e.what (); + error << "unable to execute " << args[0] << ": " << e; // In a multi-threaded program that fork()'ed but did not exec(), // it is unwise to try to do any kind of cleanup (like unwinding diff --git a/build2/cc/gcc.cxx b/build2/cc/gcc.cxx index c778493..6ad1ad1 100644 --- a/build2/cc/gcc.cxx +++ b/build2/cc/gcc.cxx @@ -90,7 +90,7 @@ namespace build2 } catch (const process_error& e) { - error << "unable to execute " << args[0] << ": " << e.what (); + error << "unable to execute " << args[0] << ": " << e; if (e.child ()) exit (1); diff --git a/build2/cc/link.cxx b/build2/cc/link.cxx index f55013f..9dbfa36 100644 --- a/build2/cc/link.cxx +++ b/build2/cc/link.cxx @@ -978,12 +978,12 @@ namespace build2 { if (pr.wait ()) // Ignore if child failed. fail << "unable to pipe resource file to " << args[0] - << ": " << e.what (); + << ": " << e; } } catch (const process_error& e) { - error << "unable to execute " << args[0] << ": " << e.what (); + error << "unable to execute " << args[0] << ": " << e; if (e.child ()) exit (1); @@ -1498,7 +1498,7 @@ namespace build2 } catch (const process_error& e) { - error << "unable to execute " << args[0] << ": " << e.what (); + error << "unable to execute " << args[0] << ": " << e; // In a multi-threaded program that fork()'ed but did not exec(), // it is unwise to try to do any kind of cleanup (like unwinding @@ -1536,7 +1536,7 @@ namespace build2 } catch (const process_error& e) { - error << "unable to execute " << args[0] << ": " << e.what (); + error << "unable to execute " << args[0] << ": " << e; if (e.child ()) exit (1); @@ -1577,7 +1577,7 @@ namespace build2 } catch (const system_error& e) { - fail << "unable to create symlink " << l << ": " << e.what (); + fail << "unable to create symlink " << l << ": " << e; } }; diff --git a/build2/cc/module.cxx b/build2/cc/module.cxx index 067aea3..40bd454 100644 --- a/build2/cc/module.cxx +++ b/build2/cc/module.cxx @@ -115,7 +115,7 @@ namespace build2 // help us out. // fail << "unable to parse " << x_lang << " compiler target '" - << ci.target << "': " << e.what () << + << ci.target << "': " << e << info << "consider using the --config-sub option"; } } diff --git a/build2/cc/windows-manifest.cxx b/build2/cc/windows-manifest.cxx index c4e86e4..44d8f7b 100644 --- a/build2/cc/windows-manifest.cxx +++ b/build2/cc/windows-manifest.cxx @@ -127,7 +127,7 @@ namespace build2 } catch (const io_error& e) { - fail << "unable to write to " << m << ": " << e.what (); + fail << "unable to write to " << m << ": " << e; } return mf; diff --git a/build2/cc/windows-rpath.cxx b/build2/cc/windows-rpath.cxx index aa1d740..35d83cc 100644 --- a/build2/cc/windows-rpath.cxx +++ b/build2/cc/windows-rpath.cxx @@ -311,7 +311,7 @@ namespace build2 if (c != EPERM && c != ENOSYS) { print ("ln -s"); - fail << "unable to create symlink " << l << ": " << e.what (); + fail << "unable to create symlink " << l << ": " << e; } try @@ -326,7 +326,7 @@ namespace build2 if (c != EPERM && c != ENOSYS) { print ("ln"); - fail << "unable to create hardlink " << l << ": " << e.what (); + fail << "unable to create hardlink " << l << ": " << e; } try @@ -337,7 +337,7 @@ namespace build2 catch (const system_error& e) { print ("cp"); - fail << "unable to create copy " << l << ": " << e.what (); + fail << "unable to create copy " << l << ": " << e; } } } @@ -371,7 +371,7 @@ namespace build2 } catch (const io_error& e) { - fail << "unable to write to " << am << ": " << e.what (); + fail << "unable to write to " << am << ": " << e; } } } -- cgit v1.1