mirror of
https://github.com/prometheus/docs.git
synced 2026-02-05 06:45:01 +01:00
Merge pull request #2680 from prometheus/krajo/fix-abnf-checker-errorcode
fix(abnf-checker): return error on example error
This commit is contained in:
@@ -105,9 +105,12 @@ if __name__ == "__main__":
|
||||
print(f"Error parsing ABNF: {e}")
|
||||
sys.exit(1)
|
||||
print("ABNF parsed successfully.")
|
||||
exit_code = 0
|
||||
for ex in examples(filename):
|
||||
try:
|
||||
Grammar.get(start_node).parse_all(ex.content)
|
||||
print(f"Example parsed successfully: {ex.line_number}: {ex.content[:30]}...") # Print first 30 chars
|
||||
except Exception as e:
|
||||
print(f"Error parsing example at line {ex.line_number}: {e}\nExample: {ex.content[:30]}...")
|
||||
exit_code = 2
|
||||
sys.exit(exit_code)
|
||||
|
||||
Reference in New Issue
Block a user