Right now if the file already exists but is not marked for deletion, the error is only caught on the server.
I would do this:
if `dataSet` is defined then there is some error because the filename is in use. If it's not marked for deletion, show the error message for that field (might need to rephrase it to mention that the filename must be unique). If it is marked for deletion, then do what you're doing now.