Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow commands to return a simple error #691

Closed
vanstee opened this issue May 12, 2016 · 2 comments
Closed

Allow commands to return a simple error #691

vanstee opened this issue May 12, 2016 · 2 comments
Assignees
Milestone

Comments

@vanstee
Copy link
Member

vanstee commented May 12, 2016

Right now if you return an error from a command, the bot prints the following message:

An error has occurred.

At `2016-05-12T20:36:16Z`, @vanstee initiated the following pipeline, assigned the unique ID `ec536613be7840189c133a932f10eaeb`:

   ` help wut`

The pipeline failed planning the invocation:

   `operable:help wut`

The specific error was:

   Whoops! An error occurred. Command "wut" does not exist

That's great for when a command unexpectedly crashes, but if you mistyped something it would be nice for the bot to just say:

help: ERROR: Command "wut" does not exist
@vanstee
Copy link
Member Author

vanstee commented May 17, 2016

We also need to allow for rendering error templates as well as raw text.

@vanstee vanstee added this to the Cog 0.7.0 milestone May 17, 2016
@kevsmith kevsmith modified the milestones: Cog 0.8.0, Cog 0.7.0 May 18, 2016
@kevsmith kevsmith modified the milestones: Cog 0.9.0, Cog 0.8.0 Jun 9, 2016
@kevsmith kevsmith modified the milestones: Cog 0.10.0, Cog 0.9.0 Jun 28, 2016
@kevsmith kevsmith self-assigned this Jul 8, 2016
@kevsmith
Copy link
Member

kevsmith commented Jul 8, 2016

Design:

Add a new response status called "abort". Add support to Relay, pycog3, and cog-rb to allow commands to signal when they wish to abort by writing COGCMD_ACTION: abort\n to stdout. When Cog receives this status it will render the body (with template if the command has specified one) and then terminate the pipeline. A "pipeline aborted" audit message will be written as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants