mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-25 23:55:38 +01:00
Improve error message
Make sure line number reported is correct for the overly long line, and change the message to be more readable. Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
parent
46bef5f929
commit
217565ef4e
@ -246,12 +246,14 @@ class ChangeLog:
|
|||||||
category.name.decode('utf8'))
|
category.name.decode('utf8'))
|
||||||
|
|
||||||
body_split = category.body.splitlines()
|
body_split = category.body.splitlines()
|
||||||
|
line_number = 1
|
||||||
for line in body_split:
|
for line in body_split:
|
||||||
if len(line) > MAX_LINE_LENGTH:
|
if len(line) > MAX_LINE_LENGTH:
|
||||||
raise InputFormatError(filename,
|
raise InputFormatError(filename,
|
||||||
line_offset + category.title_line,
|
line_offset + category.title_line + line_number,
|
||||||
'Category body line too long: "{} ({})"',
|
'Line is longer than allowed: Length {} (Max {})',
|
||||||
category.name.decode('utf8'), len(line))
|
len(line), MAX_LINE_LENGTH)
|
||||||
|
line_number += 1
|
||||||
|
|
||||||
self.categories[category.name] += category.body
|
self.categories[category.name] += category.body
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user