otherwise
Defines compensation logic with fluent "otherwise { ... }" syntax (suspend function).
This is the preferred alternative to "and undo" that enables clean chaining without intermediate variables.
Example:
first call "reserve" with { context ->
inventoryService.reserve(context.items)
} otherwise { result ->
inventoryService.release(result.id)
}Content copied to clipboard