cog
cog copied to clipboard
Fully flesh out command aborts, and the distinction between them and errors
We need to clearly lay out the usecases we want to serve with errors and aborts, as the distinction between them currently is a little muddy.
Currently, a command can include the output attribute COGCMD_ACTION: abort in its output to trigger a pipeline abort. This halts a pipeline immediately, rendering any accumulated output according to the template the aborting command specifies. It is as though the pipeline ended with that command, as typed.
In contrast, returning a non-zero exit code will cause the response to be treated as an error. In this case, the pipeline also terminates, and the standard error (not standard output) is run though our embedded error template.
The responsibility of providing useful abort output lies solely with the command author at this point. It would be good to automatically provide some indication that a pipeline aborted, how far into processing it got before aborting, what output was accumulated prior to aborting (same holds for the error case, too, for that matter).