[otBase] log the name of uharfbuzz exception

This commit is contained in:
Cosimo Lupo 2022-04-22 15:31:34 +01:00
parent 4217384e81
commit f68ce14d7a
2 changed files with 6 additions and 3 deletions

View File

@ -110,11 +110,14 @@ class BaseTTXConverter(DefaultTable):
return writer.getAllDataUsingHarfbuzz()
except (ValueError, MemoryError, hb.RepackerError) as e:
if use_hb_repack is None:
error_msg = f"{type(e).__name__}"
if str(e) != "":
error_msg += f": {e}"
log.error(
"hb.repack failed to serialize '%s', reverting to "
"pure-python serializer; the error message was: %s",
self.tableTag,
e,
error_msg,
)
return writer.getAllData(remove_duplicate=False)
# let the error propagate if USE_HARFBUZZ_REPACKER is True

View File

@ -803,7 +803,7 @@ class SubsetTest:
"installed, enabled, ok",
[
pytest.param(True, None, True, id="installed-auto-ok"),
pytest.param(True, None, True, id="installed-auto-fail"),
pytest.param(True, None, False, id="installed-auto-fail"),
pytest.param(True, True, True, id="installed-enabled-ok"),
pytest.param(True, True, False, id="installed-enabled-fail"),
pytest.param(True, False, True, id="installed-disabled"),
@ -887,7 +887,7 @@ class SubsetTest:
assert (
(
"hb.repack failed to serialize 'GSUB', reverting to "
"pure-python serializer; the error message was: mocking"
"pure-python serializer; the error message was: RepackerError: mocking"
) in caplog.text
) ^ ok