Defines if "error" action should be invoked or not.

import Batch = require("nativescript-batch");

var b = Batch.newBatch(function(ctx) {
    ctx.invokeError = false;
  
    throw "Error in operation #1";
}).error(function(ctx) {
    // [0] NOT invoked
}).then(function(ctx) {
    // do something without changing
    // ctx.invokeError
  
    throw "Error in operation #2";
}).error(function(ctx) {
    // [1] invoked
  
    console.log(ctx.error);
});

b.start();