Added error domains and error handling in the import process