Error handling for import