Skip to content

Commit 0d81653

Browse files
committed
correct error message
1 parent 73665e6 commit 0d81653

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/syntax_checker.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,18 @@ def check_details_tag(file_list):
6060
if b'<details>' in line and after_detail:
6161
error = True
6262
if b'</details>' in line and not after_detail:
63-
err_message = 'Missing opening detail tag'
63+
err_message = f'Missing opening detail tag at line {line_number}'
6464
error = True
6565

6666
if b'<details>' in line:
6767
after_detail = True
6868

6969
if b'</details>' in line and after_detail:
70-
err_message = 'Missing closing detail tag'
70+
err_message = f'Missing closing detail tag at line {line_number}'
7171
after_detail = False
7272

7373
if error:
74-
raise Exception(f'{err_message} at line {line_number -1}')
74+
raise Exception(err_message)
7575

7676

7777
def check_summary_tag(file_list):
@@ -95,18 +95,18 @@ def check_summary_tag(file_list):
9595
if b'<summary>' in line and after_detail:
9696
error = True
9797
if b'</summary>' in line and not after_detail:
98-
err_message = 'Missing opening detail tag'
98+
err_message = f'Missing opening summary tag at line {line_number}'
9999
error = True
100100

101101
if b'<summary>' in line:
102102
after_detail = True
103103

104104
if b'</summary>' in line and after_detail:
105-
err_message = 'Missing closing detail tag'
105+
err_message = f'Missing closing summary tag at line {line_number}'
106106
after_detail = False
107107

108108
if error:
109-
raise Exception(f'{err_message} at line {line_number -3}')
109+
raise Exception(err_message)
110110

111111

112112
if __name__ == '__main__':

0 commit comments

Comments
 (0)