Exceptions
Kord Extensions provides a set of extra exception types, including some we expect you to throw yourself.
All the provided exceptions extend KordExException.
This is a sentinel type, and other than extending Exception, it provides no extra functionality on its own.
Functional
The following exceptions don't necessarily represent errors or issues. Rather, they exist for you to throw in your own code when necessary.
Discord Relayed
This is a special exception you can throw in your command and component action blocks, event handlers, and pretty much
anywhere else.
When thrown, your bot will respond with the message represented by the reason property in whatever the current
execution context is.
For example, throwing a DiscordRelayedException in a chat command will make your bot reply-ping whoever invoked that
command with the message.
This exception has an alternative constructor that accepts another DiscordRelayedException, copying the reason
property from it.
You can also extend it to create your own exception types, for convenience.
Translation key representing the message to respond with.
Arguments
Your bot throws this exception when something goes wrong during command argument parsing.
Translation key representing what went wrong.
Current command Argument wrapper object, if any.
Property representing the Arguments object you wrote to contain your command's arguments.
For chat commands, the tokenising string parser used.
Your bot throws this exception when it has a misconfigured command argument.
Converter builder that failed to validate.
The validation failure reason.
Commands
Your bot throws this exception when it fails to register a command.
Name of the command that failed to register.
Why registration failed.
Your bot throws this exception when it has a misconfigured command.
Name of the command that failed to validate.
May be null in some cases — for example, if validation fails because the command has no name.
The validation failure reason.
Events
Your bot throws this exception when it fails to register an event handler.
Event handler that failed to register.
Why registration failed.
Your bot throws this exception when it has a misconfigured event handler.
Event handler that failed to validate.
The validation failure reason.
Extensions
Your bot throws this exception when it has a misconfigured extension.
The invalid extension class.
Why the extension is invalid.
Parser Exceptions
All general parsing exceptions extend BaseParserException.
This is a sentinel type, and other than extending KordExException, it provides no extra functionality on its own.
Duration Parser
Base type for all duration parser exceptions.
Translation key representing what went wrong.
Exception thrown when the parser encounters an invalid time unit.
The invalid time unit.