[feaLib] Improve exception message

This commit is contained in:
Khaled Hosny 2020-04-27 18:13:18 +02:00
parent 4526e164f1
commit e0c49a1d4a
2 changed files with 6 additions and 4 deletions

View File

@ -1264,7 +1264,8 @@ class ChainContextPosBuilder(LookupBuilder):
for sequenceIndex, l in enumerate(lookups):
if l is not None:
if l.lookup_index is None:
raise FeatureLibError('Missing lookup index',
raise FeatureLibError('Missing index of the specified '
'lookup, might be a substitution lookup',
self.location)
rec = otTables.PosLookupRecord()
rec.SequenceIndex = sequenceIndex
@ -1314,7 +1315,8 @@ class ChainContextSubstBuilder(LookupBuilder):
for sequenceIndex, l in enumerate(lookups):
if l is not None:
if l.lookup_index is None:
raise FeatureLibError('Missing lookup index',
raise FeatureLibError('Missing index of the specified '
'lookup, might be a positioning lookup',
self.location)
rec = otTables.SubstLookupRecord()
rec.SequenceIndex = sequenceIndex

View File

@ -433,7 +433,7 @@ class BuilderTest(unittest.TestCase):
def test_chain_subst_refrences_GPOS_looup(self):
self.assertRaisesRegex(
FeatureLibError,
"Missing lookup index",
"Missing index of the specified lookup, might be a positioning lookup",
self.build,
"lookup dummy { pos a 50; } dummy;"
"feature test {"
@ -444,7 +444,7 @@ class BuilderTest(unittest.TestCase):
def test_chain_pos_refrences_GSUB_looup(self):
self.assertRaisesRegex(
FeatureLibError,
"Missing lookup index",
"Missing index of the specified lookup, might be a substitution lookup",
self.build,
"lookup dummy { sub a by A; } dummy;"
"feature test {"