Jam.py documentation

abort

abort(message)

domain: client

language: javascript

class AbstractItem

Description

Use abort method to throw exception.

It can be usefull when you need to abort execution of some ‘on_before’ events.

Example

The following code will throw exception with the text:

execution aborted: invoice_table - a quantity value is required

function on_before_post(item) {
    if (item.quantity.value === 0) {
        item.abort('a quantity value is required');
    }
}