Fix catching errors in import script