Defines the "error" action.
import Batch = require("nativescript-batch");
var b = Batch.newBatch(function(ctx) {
throw "This is an error!";
}).success(function(ctx) {
// will not be invoked
}).error(function(ctx) {
console.log("ERROR: " + ctx.error);
});
b.start();