Throw a more explicit exception, instead of InvalidArgumentException, when generating a file that already exists and not in overwrite mode