Show specific error on property line found before :PROPERTIES: one.

This commit is contained in:
Sergio Martínez Portela 2020-12-10 00:15:30 +01:00
parent b2779dbc41
commit ffd82c2d76

View File

@ -1029,7 +1029,15 @@ class OrgDomReader:
elif as_time := parse_org_time(value): elif as_time := parse_org_time(value):
value = as_time value = as_time
self.current_drawer.append(Property(linenum, match, key, value, None)) try:
self.current_drawer.append(Property(linenum, match, key, value, None))
except:
if "current_drawer" not in dir(self): # Throw a better error on this case
raise Exception(
"Found properties before :PROPERTIES: line. Error on Org file?"
)
else:
raise # Let the exception pass
def read(self, s, environment): def read(self, s, environment):
lines = s.split("\n") lines = s.split("\n")