License | BSD (see the LICENSE file) |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Command.Error
Description
Provides the errors for Commands. Its usage is mainly internal, to be used from Command.Command.
Documentation
data CommandError Source #
This represents any error that can arise from an invocation of a command.
Some are thrown by the system (such as ArgumentParseError), however you can
also manually throw them with throwM
within any handler.
Constructors
ArgumentParseError Text | Indicates the command arguments failed to parse, either because of lack of arguments, incorrect types, or too many arguments. |
RequirementError Text | Indicates that a requirement for this command failed to pass. The reason is specified in the text field. |
ProcessingError Text | This is a value unused by the system, and is free to be used by the handler as they wish. |
DiscordError RestCallErrorCode | Indicates there was a fatal Discord call somewhere in the handler. |
HaskellError SomeException | Indicates there was some sort of runtime error. This contains all sorts of errors, however they are guaranteed to be safe synchronous exceptions. |
Instances
Show CommandError Source # | |
Defined in Command.Error Methods showsPrec :: Int -> CommandError -> ShowS # show :: CommandError -> String # showList :: [CommandError] -> ShowS # | |
Exception CommandError Source # | |
Defined in Command.Error Methods toException :: CommandError -> SomeException # fromException :: SomeException -> Maybe CommandError # displayException :: CommandError -> String # |