Skip to content

Commit 62ae41f

Browse files
committed
generate the description of each section
1 parent e85215c commit 62ae41f

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

modules/ROOT/pages/errors/gql-errors/index.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Please note that while GQLSTATUS codes remain stable (any changes to them will b
1212
For this reason, parsing the status descriptions or incorporating them into scripts is not recommended.
1313
====
1414

15-
[[connection-exception]]
16-
== Connection exception
15+
[[connection-exceptions]]
16+
== Connection exceptions
1717

1818
Connection exceptions occur when the client (e.g. Browser/Bloom/Cypher Shell) is unable to connect to the server for various reasons such as network issues, server-side routing being disabled, or the database being unavailable, etc.
1919

@@ -1963,8 +1963,8 @@ Status description:: error: function exception - function execution error. Execu
19631963

19641964
Status description:: error: function exception - custom function execution error cause. Execution of the function `{ <<fun>> }` failed due to `{ <<msgTitle>> }`: `{ <<msg>> }`.
19651965

1966-
[[dependent-object-error]]
1967-
== Dependent object error
1966+
[[dependent-object-errors]]
1967+
== Dependent object errors
19681968

19691969
=== xref:errors/gql-errors/G1001.adoc[G1001]
19701970

scripts/generate_gql_error_index.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def get_section_for_error_code(error_code):
8585

8686
# Try to match the first two characters
8787
prefix = error_code[:2]
88-
return sections.get(prefix, 'General processing exception') # Default to general if no match
88+
return sections.get(prefix, 'General processing exceptions') # Default to general if no match
8989

9090
def get_section_order():
9191
"""Define the order in which sections should appear in the index."""
@@ -157,8 +157,10 @@ def generate_index(errors_dir, output_file, original_index, include_descriptions
157157

158158
# Add section description if available
159159
if section in section_descriptions:
160-
content.append(section_descriptions[section])
161-
content.append('')
160+
description = section_descriptions[section]
161+
if description and description.strip():
162+
content.append(description)
163+
content.append('')
162164

163165
# Add error codes for this section
164166
for error_code in sections[section]:
@@ -168,6 +170,15 @@ def generate_index(errors_dir, output_file, original_index, include_descriptions
168170
content.append(f'Status description:: {error_codes[error_code]}')
169171
content.append('')
170172

173+
# Add glossary section once at the end of the document (outside both loops)
174+
content.append('')
175+
content.append('ifndef::backend-pdf[]')
176+
content.append('[discrete.glossary]')
177+
content.append('== Glossary')
178+
content.append('')
179+
content.append('include::partial$glossary.adoc[]')
180+
content.append('endif::[]')
181+
171182
# Write the index file
172183
with open(output_file, 'w') as f:
173184
f.write('\n'.join(content))

0 commit comments

Comments
 (0)