Skip to content

Commit

Permalink
Improve error message when keyword not found. See #491.
Browse files Browse the repository at this point in the history
  • Loading branch information
Moult committed Sep 22, 2021
1 parent 0f73c43 commit d03ab15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ifcopenshell-python/ifcopenshell/express/templates.py
Expand Up @@ -190,14 +190,14 @@ class IFC_PARSE_API %(name)s : %(superclass)s {
}
const char* %(schema_name)s::%(name)s::ToString(Value v) {
if ( v < 0 || v >= %(max_id)d ) throw IfcException("Unable to find find keyword in schema");
if ( v < 0 || v >= %(max_id)d ) throw IfcException("Unable to find keyword in schema");
const char* names[] = { %(values)s };
return names[v];
}
%(schema_name)s::%(name)s::Value %(schema_name)s::%(name)s::FromString(const std::string& s) {
%(from_string_statements)s
throw IfcException("Unable to find find keyword in schema");
throw IfcException("Unable to find keyword in schema: " + s);
}
%(schema_name)s::%(name)s::operator %(schema_name)s::%(name)s::Value() const {
Expand All @@ -210,7 +210,7 @@ class IFC_PARSE_API %(name)s : %(superclass)s {
%(inverse)s
const IfcParse::entity& %(schema_name)s::%(name)s::declaration() const { return *%(schema_name_upper)s_%(name)s_type; }
const IfcParse::entity& %(schema_name)s::%(name)s::Class() { return *%(schema_name_upper)s_%(name)s_type; }
%(schema_name)s::%(name)s::%(name)s(IfcEntityInstanceData* e) : %(superclass)s { if (!e) return; if (e->type() != %(schema_name_upper)s_%(name)s_type) throw IfcException("Unable to find find keyword in schema"); data_ = e; }
%(schema_name)s::%(name)s::%(name)s(IfcEntityInstanceData* e) : %(superclass)s { if (!e) return; if (e->type() != %(schema_name_upper)s_%(name)s_type) throw IfcException("Unable to find keyword in schema"); data_ = e; }
%(schema_name)s::%(name)s::%(name)s(%(constructor_arguments)s) : %(superclass)s {data_ = new IfcEntityInstanceData(%(schema_name_upper)s_%(name)s_type); %(constructor_implementation)s }
"""

Expand Down

0 comments on commit d03ab15

Please sign in to comment.