mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 12:09:51 +02:00
feat: mature error handling system
This commit is contained in:
1 parent
1875f30cf5
commit
524edac615
23 files changed
+87
-87
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
|
||||
import { BlitzServer } from '../../constants/servers.js';
|
||||
import negativeEmbed from '../interaction/negativeEmbed.js';
|
||||
import errorWithCause from '../process/errorWithCause.js';
|
||||
import { serverAndIdPattern } from './getBlitzAccount.js';
|
||||
import listClansPanServer from './listClansPanServer.js';
|
||||
|
||||
@@ -17,16 +17,10 @@ export default async function getBlitzClan(
|
||||
if (accounts[0]) {
|
||||
return { server: accounts[0].server, id: accounts[0].clan_id };
|
||||
} else {
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
negativeEmbed(
|
||||
'Could not find clan',
|
||||
`I couldn't find clan \`${clan}\`. Try selecting a username from the search result.`,
|
||||
),
|
||||
],
|
||||
});
|
||||
|
||||
throw new Error(`Could not find clan "${clan}"`);
|
||||
throw errorWithCause(
|
||||
'Could not find clan',
|
||||
`I couldn't find clan \`${clan}\`. Try selecting a username from the search result.`,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user