diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-22 12:10:03 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-22 12:10:03 +0200 |
commit | 557269660c1d9796a7cf9e911efb9262f645e359 (patch) | |
tree | 0323bcb5a90c339fe87fcd193cf71bdcb3431c91 /build2/utility.cxx | |
parent | fae6cd2235c907e077dad7b5d8dc9b6d90a78a37 (diff) |
Use diagnostics facility from libbutl
Diffstat (limited to 'build2/utility.cxx')
-rw-r--r-- | build2/utility.cxx | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/build2/utility.cxx b/build2/utility.cxx index 5d65f7b..e4b5254 100644 --- a/build2/utility.cxx +++ b/build2/utility.cxx @@ -15,23 +15,27 @@ using namespace std; -namespace build2 -{ - // - // <build2/types> - // +// +// <build2/types> +// +namespace std +{ ostream& - operator<< (ostream& os, const path& p) + operator<< (ostream& os, const ::butl::path& p) { + using namespace build2; + return os << (stream_verb (os) < 2 ? diag_relative (p) : p.representation ()); } ostream& - operator<< (ostream& os, const process_path& p) + operator<< (ostream& os, const ::butl::process_path& p) { + using namespace build2; + if (p.empty ()) os << "<empty>"; else @@ -47,7 +51,10 @@ namespace build2 return os; } +} +namespace build2 +{ // // <build2/utility> // @@ -153,8 +160,7 @@ namespace build2 } catch (const process_error& e) { - error << "unable to execute " << args0 << ": " << e.what (); - throw failed (); + fail << "unable to execute " << args0 << ": " << e.what () << endf; } process_path @@ -165,8 +171,7 @@ namespace build2 } catch (const process_error& e) { - error << "unable to execute " << f << ": " << e.what (); - throw failed (); + fail << "unable to execute " << f << ": " << e.what () << endf; } process @@ -191,9 +196,7 @@ namespace build2 exit (1); } else - error << "unable to execute " << args[0] << ": " << e.what (); - - throw failed (); + fail << "unable to execute " << args[0] << ": " << e.what () << endf; } } @@ -222,8 +225,7 @@ namespace build2 } catch (const process_error& e) { - error << "unable to execute " << args[0] << ": " << e.what (); - throw failed (); + fail << "unable to execute " << args[0] << ": " << e.what () << endf; } const string empty_string; @@ -504,8 +506,6 @@ namespace build2 return r; } - bool exception_unwinding_dtor = false; - void init (const char* a0, uint16_t v) { |