fs/Charset: throw exception on error

This commit is contained in:
Max Kellermann
2016-04-12 21:24:16 +02:00
parent a0eb6d0976
commit 6513ff92a7
4 changed files with 29 additions and 26 deletions

View File

@@ -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