Skip to content

fix: add error handling for missing or malformed legal_sections.json [GSSOC'26]#618

Open
rudra3007-pro wants to merge 1 commit into
viru0909-dev:mainfrom
rudra3007-pro:fix/legal-sections-file-error-handling
Open

fix: add error handling for missing or malformed legal_sections.json [GSSOC'26]#618
rudra3007-pro wants to merge 1 commit into
viru0909-dev:mainfrom
rudra3007-pro:fix/legal-sections-file-error-handling

Conversation

@rudra3007-pro
Copy link
Copy Markdown
Contributor

Description

Closes #617

Added try/except inside _load_legal_sections() to handle missing or
malformed JSON file with clear descriptive error messages instead of
generic Python errors.

Changes:

  • Added FileNotFoundError with descriptive message
  • Added json.JSONDecodeError catch raising ValueError with details

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

@rudra3007-pro is attempting to deploy a commit to the CodeBlooded's projects Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nyaysetu Ready Ready Preview, Comment May 25, 2026 4:51am

@Mohitswamii
Copy link
Copy Markdown
Contributor

Hi @viru0909-dev,

I noticed that issue #617 currently has an open PR linked to it. If additional improvements or refinements are needed for this issue, I would be happy to contribute.

Please let me know if I can work on it under GSSoC 2026. Thank you!

@rudra3007-pro
Copy link
Copy Markdown
Contributor Author

@viru0909-dev Please review this PR

2 similar comments
@rudra3007-pro
Copy link
Copy Markdown
Contributor Author

@viru0909-dev Please review this PR

@rudra3007-pro
Copy link
Copy Markdown
Contributor Author

@viru0909-dev Please review this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: No error handling if legal_sections.json is missing or malformed

2 participants