Error during import

Hi All,

I have applied before save logic hook,my logic is to check duplicate 'custom field' before saving the record, this functionality is working fine, system also showing popup error message and unable to save the duplicate record.

but when i inserted the record via import facility, and my csv file has duplicate record then i got below error.
could any body suggest me what should i do to fix below error