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

Does worksmith have a "break" feature #2

Open
cressie176 opened this issue May 25, 2015 · 0 comments
Open

Does worksmith have a "break" feature #2

cressie176 opened this issue May 25, 2015 · 0 comments

Comments

@cressie176
Copy link

I have an error flow which sends a 400 response, effectively handling the error, after which I'd like to terminate.

If I set handleError to true the next activity will continue. If I propagate the error my init code will detect it and pass it to my default express error handler which will attempt to send a 500.

function(req, res, next) {
    workflow({ req: req, res: res }, function(err) {
        if (err) return next(err)
    })
}

My workaround is to decorate the error with a handled property and use this in my init code, i.e.

function(req, res, next) {
    workflow({ req: req, res: res }, function(err) {
        if (err && !err.handled) return next(err)
    })
}

however it would be nice if activities had an explicit break clause

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

1 participant