diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2019-08-16 17:57:54 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2019-08-16 17:57:54 +0300 |
commit | 0fb8bc472aafaacb6bff3b9f6a3af2df1aa8dc8a (patch) | |
tree | 067dbb2b5f8fc77ac2caa7715183e8f7f58fc609 /bdep/utility.cxx | |
parent | ffdf220f64c7362bf06f8d43aa9820ed4634fdbb (diff) |
Fix uncaught invalid_path exception
Diffstat (limited to 'bdep/utility.cxx')
-rw-r--r-- | bdep/utility.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bdep/utility.cxx b/bdep/utility.cxx index 9c8057e..148610b 100644 --- a/bdep/utility.cxx +++ b/bdep/utility.cxx @@ -95,6 +95,25 @@ namespace bdep } } + dir_path& + normalize (dir_path& d, const char* what) + { + try + { + d.complete ().normalize (); + } + catch (const invalid_path& e) + { + fail << "invalid " << what << " directory " << e.path; + } + catch (const system_error& e) + { + fail << "unable to obtain current directory: " << e; + } + + return d; + } + bool exists (const path& f, bool ignore_error) { |