Error

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

Basic Usage

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* 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