mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 10:11:46 +00:00
Defer execution of error details
This commit is contained in:
@@ -338,14 +338,14 @@ class file:
|
|||||||
from . import Error, SchemaError
|
from . import Error, SchemaError
|
||||||
|
|
||||||
exc, msg = {
|
exc, msg = {
|
||||||
READ_ERROR: (IOError, "Unable to open file for reading"),
|
READ_ERROR: lambda: (IOError, "Unable to open file for reading"),
|
||||||
NO_HEADER: (Error, "Unable to parse IFC SPF header"),
|
NO_HEADER: lambda: (Error, "Unable to parse IFC SPF header"),
|
||||||
UNSUPPORTED_SCHEMA: (
|
UNSUPPORTED_SCHEMA: lambda: (
|
||||||
SchemaError,
|
SchemaError,
|
||||||
"Unsupported schema: %s" % ",".join(f.header.file_schema.schema_identifiers),
|
"Unsupported schema: %s" % ",".join(f.header.file_schema.schema_identifiers),
|
||||||
),
|
),
|
||||||
INVALID_SYNTAX: (Error, "Syntax error during parse, check logs"),
|
INVALID_SYNTAX: lambda: (Error, "Syntax error during parse, check logs"),
|
||||||
}[f.good().value()]
|
}[f.good().value()]()
|
||||||
raise exc(msg)
|
raise exc(msg)
|
||||||
self.wrapped_data = f
|
self.wrapped_data = f
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user