class DiscordMiddleware::Error
- DiscordMiddleware::Error
- Reference
- Object
Overview
This middleware immediately calls the next middleware in the chain, and if any subsequent middleware raises an exception, it will be caught by this middleware allowing the user to trigger additional handling. Such as, for example, responding to the user with an error message or doing extra logging at the time of exception.
It can be initialized with a string that will be used as a canned response. The text "%exception%" will be replaced with the exception's message if provided. Alternatively, it can be initialized with a block for any other custom behavior.