From 0fb8bc472aafaacb6bff3b9f6a3af2df1aa8dc8a Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 16 Aug 2019 17:57:54 +0300 Subject: Fix uncaught invalid_path exception --- bdep/utility.cxx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'bdep/utility.cxx') 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) { -- cgit v1.1