Annotation Interface Error
@ConvertedBy(Converter.class)
@DocMultiple(preface="**Possible Errors:**\n\n",
prefixEach="+ ",
separateBy="\n\n")
@Documented
@Repeatable(Errors.class)
@Retention(RUNTIME)
@Target({TYPE,METHOD})
public @interface Error
A CommandDoc
Annotation
that describes
a possible error or termination clause a Command might have during it's runtime.
These are formatted ways to describe errors and provide the response()
method for specifying the bot's response if the error occurs.
Multiples of these can be applied using the
@Errors
annotation, or simply
multiples of these can be attached to a class or method.
Below is a visual of what this should generally look like:
Possible Errors: • "I encountered an issue while processing this command!" - Houston had a problem! • "You used this command too fast" - b1nzy's fault! • "An unexpected error occurred!" - Let's just blame Onitor!
- Since:
- 2.0
- Author:
- Kaidan Gustave
- See Also:
-
Nested Class Summary
-
Required Element Summary
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionA prefix appended to the front of the produced String during conversion.A response message that would normally be sent if this error occurs, as a means of users identifying the error without an idea of what exactly went wrong.
-
Element Details
-
value
String valueA brief description of what caused the error.- Returns:
- A description of what caused the error.
-
response
String responseA response message that would normally be sent if this error occurs, as a means of users identifying the error without an idea of what exactly went wrong.- Returns:
- A response message.
- Default:
""
-
prefix
String prefixA prefix appended to the front of the produced String during conversion.
Only really useful or needed when a Command has multiple@Error
annotations, for the purpose of listing.- Returns:
- A prefix for the conversion, useful when multiple @Errors are specified.
- Default:
""
-