diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-02-03 22:54:17 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-02-03 22:54:17 +0100 |
commit | ec6306ad1e746d47ed66af6274fb6710c70933a2 (patch) | |
tree | d00627f99142e62f98894861673a91e14c6eb834 /src/core/parser/ParserScope.cpp | |
parent | 7a8a8a31416cfebf785135754035608f4d919bf5 (diff) |
Fixed XML-Importer failing
Diffstat (limited to 'src/core/parser/ParserScope.cpp')
-rw-r--r-- | src/core/parser/ParserScope.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/core/parser/ParserScope.cpp b/src/core/parser/ParserScope.cpp index 1937697..b97dabd 100644 --- a/src/core/parser/ParserScope.cpp +++ b/src/core/parser/ParserScope.cpp @@ -90,10 +90,23 @@ Rooted<Node> ParserScopeBase::select(RttiSet types, int maxDepth) return nodes[i]; } } - throw LoggableException{ - std::string( - "Expected be inside an element of one of the internal types ") + - Utils::join(types, "\", \"", "\"", "\"")}; + return nullptr; +} + +Rooted<Node> ParserScopeBase::selectOrThrow(RttiSet types, int maxDepth) +{ + Rooted<Node> res = select(types, maxDepth); + if (res == nullptr) { + std::vector<std::string> typenames; + for (auto type : types) { + typenames.push_back(type->name); + } + throw LoggableException{std::string( + "Expected to be inside an element of one " + "of the internal types ") + + Utils::join(typenames, "\", \"", "\"", "\"")}; + } + return res; } /* Class DeferredResolution */ |