diff options
author | Max Kellermann <max@duempel.org> | 2016-04-12 21:24:16 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2016-04-21 14:23:55 +0200 |
commit | 6513ff92a7012819db464adad094b69e8b585127 (patch) | |
tree | 1f4657391f9505f145abdbcca05bbb5d7c331d9d /src/fs/Path.cxx | |
parent | a0eb6d0976e5b5136769341f3bb3a03d096be46c (diff) |
fs/Charset: throw exception on error
Diffstat (limited to 'src/fs/Path.cxx')
-rw-r--r-- | src/fs/Path.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/fs/Path.cxx b/src/fs/Path.cxx index cb8acd3fe..d28dbc1d4 100644 --- a/src/fs/Path.cxx +++ b/src/fs/Path.cxx @@ -21,10 +21,16 @@ #include "Path.hxx" #include "Charset.hxx" +#include <stdexcept> + std::string Path::ToUTF8() const { - return ::PathToUTF8(c_str()); + try { + return ::PathToUTF8(c_str()); + } catch (const std::runtime_error &) { + return std::string(); + } } Path::const_pointer_type |