Error

⚠ Deprecated

Error object is used to create a JavaScript Error object with additional execution stack trace information.

Basic Usage

/* globals $ */
/* eslint-env node, dirigible */

var response = require('net/http/response');
var errorUtils = require('utils/error');

processRequest();

function processRequest() {
	var error = createError();
	response.println(JSON.stringify(error, null, 2));
	response.flush();
	response.close();
}

function createError() {
	return errorUtils.createError('Error Message');
}

Definition

Functions


Function Description Returns
createError(errorMessage) Creates an Error with the error message argument and a execution stack trace Error

Compatibility

Rhino Nashorn V8
Edit