Change exception type in file path validation