Skip to content

Release v4.14.2 - Enhanced SEC Error Handling

Choose a tag to compare

@dgunning dgunning released this 25 Sep 02:09
· 2114 commits to main since this release

Enhanced SEC Error Handling in SGML Parsing

This release significantly improves the user experience when encountering SEC API errors by replacing generic error messages with specific, actionable guidance.

🎯 Key Improvements

Problem Solved: Users previously received unhelpful "Unknown SGML format" errors when SEC returned error responses, making it difficult to diagnose and resolve issues.

Solution: Added intelligent error detection and custom exception classes that provide clear, actionable guidance for common SEC API issues.

🔧 What's New

  • Custom Exception Classes:

    • SECIdentityError: For invalid or missing EDGAR_IDENTITY issues
    • SECFilingNotFoundError: For missing filings and AWS S3 NoSuchKey errors
    • SECHTMLResponseError: For other unexpected HTML/XML responses
  • Enhanced Error Detection:

    • Detects SEC identity error HTML responses
    • Handles AWS S3 NoSuchKey XML error responses
    • Provides fallback for generic HTML/XML content
  • Actionable Error Messages:

    • Clear instructions for setting up EDGAR_IDENTITY
    • Specific guidance for missing filing errors
    • Links to SEC documentation for proper API usage

📋 Error Handling Examples

Before:

ValueError: Unknown SGML format

After:

SECIdentityError: SEC rejected request due to invalid or missing EDGAR_IDENTITY. 
Please set a valid identity using set_identity('Your Name your.email@domain.com'). 
See https://www.sec.gov/os/accessing-edgar-data

🧪 Testing

  • Comprehensive test coverage for all error scenarios
  • Validation of error message quality and actionability
  • Preserved existing SGML parsing functionality

This enhancement makes EdgarTools more user-friendly and helps developers quickly resolve common SEC API issues.


Published to PyPI: https://pypi.org/project/edgartools/4.14.2/