feat: no embed errors

This commit is contained in:
TrèsAbhi committed 2024-01-21 18:29:32 -06:00
1 parent 6094875ffb
commit 8946f115c0
8 files changed
+15 -33

No files matched your search

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