mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 09:14:59 +00:00
fix: move except ValueError
up right after find_original_update_blocks
This commit is contained in:
parent
1e1bb53ca3
commit
9982863042
1 changed files with 19 additions and 18 deletions
|
@ -31,6 +31,10 @@ def process_markdown(filename):
|
||||||
# Process the content with find_original_update_blocks
|
# Process the content with find_original_update_blocks
|
||||||
try:
|
try:
|
||||||
blocks = list(find_original_update_blocks(content, DEFAULT_FENCE))
|
blocks = list(find_original_update_blocks(content, DEFAULT_FENCE))
|
||||||
|
except ValueError as e:
|
||||||
|
# If an error occurs, add it to the results for this section
|
||||||
|
results.append({"header": header, "error": str(e)})
|
||||||
|
continue
|
||||||
|
|
||||||
# Create a dictionary for this section
|
# Create a dictionary for this section
|
||||||
section_result = {"header": header, "blocks": []}
|
section_result = {"header": header, "blocks": []}
|
||||||
|
@ -49,9 +53,6 @@ def process_markdown(filename):
|
||||||
)
|
)
|
||||||
|
|
||||||
results.append(section_result)
|
results.append(section_result)
|
||||||
except ValueError as e:
|
|
||||||
# If an error occurs, add it to the results for this section
|
|
||||||
results.append({"header": header, "error": str(e)})
|
|
||||||
|
|
||||||
# Output the results as JSON
|
# Output the results as JSON
|
||||||
print(json.dumps(results, indent=4))
|
print(json.dumps(results, indent=4))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue