Defines the "completed" action.

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

var b = Batch.newBatch(function(ctx) {
    throw "This is an error!";
}).error(function(ctx) {
    console.log("ERROR (error): " + ctx.error);
}).success(function(ctx) {
    // will not be invoked
}).complete(function(ctx) {
    console.log("ERROR (complete): " + ctx.error);
});

b.start();