Error handling and processing