operable / cog-rb

Simple, opinionated library for building Cog bundles in Ruby
Other
6 stars 2 forks source link

Allow commands to abort pipeline execution #4

Closed kevsmith closed 8 years ago

kevsmith commented 8 years ago

Implements Ruby command-facing API for the design described in #691.

Fixes #691

christophermaier commented 8 years ago

If "abort" is for handled error scenarios but an error is unhandled, we should probably revise Cog::Command#fail and the rescue block from Cog::Command#execute. Current uses of #fail should migrate over to using #abort + appropriate templates (meaning #fail should be deprecated), while the rescue block should be loosened to support any exception.

kevsmith commented 8 years ago

Sounds reasonable for exception handling but out of scope for this initial pass, I think. I was focusing on getting the ability implemented in all the right places figuring then we can adapt command behavior to take advantage of it.

christophermaier commented 8 years ago

Sounds good. We've got a number of commands that use #fail right now, so it'll take a bit of typing to get everything migrated over anyway; that shouldn't block this.