Error handling and reporting