Transaction Error Reports

By default, exceptions are automatically detected by the tracer. If your business logic defines the transaction as "in error" for any other reason, you can customize the error report method to mark the transaction in error.

The following code snippet demonstrates how to create a transaction error report:

// Transaction Error Report
module.exports.apiTransactionErrorReport = function(event, context, callback) {
setTimeout(function () {
tracer.reportTransactionError(new Error('API Error'));
callback(null, {
statusCode: 200,
body: 'Transaction Error Reported'
});
}, 100);
}