Gets the thrown error (if available).

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

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

b.start();