Show error when adding a user. Script AD

Options

I do the migration of users from my AD to the TV, when I run the script it passes me by all the users and if for any reason of the error it does not point at me. Is there any way to make the script warn me of the error and in which user gave the error?