Ignore errors when canonicalizing paths for automation

It's only being done to make the error reporting prettier, so it failing
shouldn't block the loading of the file.
This commit is contained in:
Thomas Goyne 2013-12-23 11:37:19 -08:00
parent 41ce8d7c31
commit 22e4a8bd58
1 changed files with 7 additions and 1 deletions

View File

@ -31,7 +31,13 @@
namespace Automation4 {
bool LoadFile(lua_State *L, agi::fs::path const& raw_filename) {
auto filename = agi::fs::Canonicalize(raw_filename);
auto filename = raw_filename;
try {
filename = agi::fs::Canonicalize(raw_filename);
}
catch (agi::fs::FileSystemUnknownError const& e) {
LOG_E("auto4/lua") << "Error canonicalizing path: " << e.GetChainedMessage();
}
std::unique_ptr<std::istream> file(agi::io::Open(filename, true));
file->seekg(0, std::ios::end);