Release v4.14.2 - Enhanced SEC Error Handling
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 issuesSECFilingNotFoundError: For missing filings and AWS S3 NoSuchKey errorsSECHTMLResponseError: 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/