Report errors in string escape sequences more verbosely

This commit is contained in:
Thomas Krijnen
2016-07-19 16:41:36 +02:00
parent cd2b0c3a05
commit fd4086aa8d
3 changed files with 21 additions and 4 deletions
+9 -2
View File
@@ -1098,8 +1098,15 @@ bool IfcFile::Init(IfcParse::IfcSpfStream* s) {
MaxId = (std::max)(MaxId,currentId);
currentId = 0;
} else {
try { token = tokens->Next(); }
catch (... ) { token = NoneTokenPtr(); }
try {
token = tokens->Next();
} catch (const IfcException& e) {
Logger::Message(Logger::LOG_ERROR, std::string(e.what()) + ". Parsing terminated");
token = NoneTokenPtr();
} catch (...) {
Logger::Message(Logger::LOG_ERROR, "Parsing terminated");
token = NoneTokenPtr();
}
}
if ( ! (token.startPos || token.lexer) ) break;