Skip to content

Does worksmith have a "break" feature #2

Open
@cressie176

Description

@cressie176

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions