Optimization: Improve error handling and reporting.