Skip to content

Commit

Permalink
improve error message #1979
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi committed May 3, 2024
1 parent 3ec3384 commit 0c751b9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/renderer/src/util/outputNameTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ function getOutSegProblems({ fileNames, filePath, outputDir, safeOutputFileName
error = i18n.t('At least one resulting file name has no length');
break;
}
if ([...fileName].some((char) => invalidChars.has(char))) {
error = i18n.t('At least one resulting file name contains invalid characters');
const matchingInvalidChars = new Set([...fileName].filter((char) => invalidChars.has(char)));
if (matchingInvalidChars.size > 0) {
error = i18n.t('At least one resulting file name contains invalid character(s): {{invalidChars}}', { invalidChars: `"${[...matchingInvalidChars].join('", "')}"` });
break;
}
if (sameAsInputPath) {
Expand Down

0 comments on commit 0c751b9

Please sign in to comment.