Overview
Implement a comprehensive error handling system with typed errors that provide context about parsing failures, making debugging easier and enabling better error recovery strategies.
Tasks
Error Types
Error Context
Strictness Integration
Example Usage
feed, err := parser.Parse(reader, opts)
if err != nil {
var parseErr *gofeed.ParseError
if errors.As(err, &parseErr) {
fmt.Printf("Parse error at line %d: %s\n", parseErr.Line, parseErr.Message)
fmt.Printf("Context: %s\n", parseErr.Context)
}
}
Benefits
- Easier debugging with specific error information
- Better error messages for end users
- Programmatic error handling based on error type
- Improved logging and monitoring capabilities
Related Issues
Overview
Implement a comprehensive error handling system with typed errors that provide context about parsing failures, making debugging easier and enabling better error recovery strategies.
Tasks
Error Types
ParseError- Malformed XML/JSON structureValidationError- Missing required fields, invalid valuesNetworkError- HTTP failures, timeouts (already have HTTPError)FormatError- Unknown feed type, unsupported versionExtensionError- Problems parsing extensionsError Context
errors.Is()anderrors.As()Strictness Integration
Example Usage
Benefits
Related Issues