Closed
Description
What would you like to be added?
Add an action that allows throwing an error
Why is this needed?
Allows to define and throw workflow-specific errors, which is not possible as of now.
Coupled with the action's condition
property, it could provide users a very powerfull - yet extremely simple - tool to perform flow and/or data validation logic.
What is your proposal?
Create a new throw
or error
action type, that allows users to do the following:
actions:
- name: is-room-available
functionRef:
refName: check-if-room-is-available
arguments:
id: 123
actionDataFilter:
toStateData: .roomAvailable
- name: throw-if-not-true
condition: ${ .roomAvailable == false }
errorRef:
refName: room-not-available
If, as suggested in #770, we get rid of the top-level errors
property, then it could instead look like:
actions:
- name: is-room-available
functionRef:
refName: check-if-room-is-available
arguments:
id: 123
actionDataFilter:
toStateData: .roomAvailable
- name: throw-if-not-true
condition: ${ .roomAvailable == false }
throw:
type: https://fake.hotel.com/errors/room-not-available
status: 409
title: Room Not Available
Metadata
Metadata
Assignees
Type
Projects
Status
Done