Merge branch 'main' into dev

This commit is contained in:
TrèsAbhi committed 2024-02-23 16:05:29 -06:00
commit 23a33c7722
45 files changed
+743 -504

No files matched your search

+7 -6
View File
@@ -1,5 +1,6 @@
import { go } from 'fuzzysort';
import { UserError } from '../../hooks/userError';
import markdownEscape from 'markdown-escape';
import {
tankDefinitions,
tanksDefinitionsArray,
@@ -15,9 +16,9 @@ export default async function resolveTankId(tank: string | number) {
});
if (searchResult.length === 0) {
throw new UserError('Tank not found', {
cause: `Could not find tank by the name "${tank}".`,
});
throw new UserError(
`# Tank not found\nCould not find tank by the name "${markdownEscape(`${tank}`)}".`,
);
} else {
return searchResult[0].obj.id;
}
@@ -25,9 +26,9 @@ export default async function resolveTankId(tank: string | number) {
if ((await tankDefinitions)[number]) {
return number;
} else {
throw new UserError('Tank not found', {
cause: `Could not find tank by the ID "${number}".`,
});
throw new UserError(
`# Tank not found\nCould not find tank by the ID "${number}". Try typing the name of the tank instead of a number.`,
);
}
}
}