error.SuiteScriptError
Object Description |
Encapsulates a custom SuiteScript error for any server script type that is not a user event script. Use this object in a try-catch statement to abort script execution. Create a new custom error with the error.create(options) method, which returns an |
Supported Script Types |
All server scripts that are not user event scripts. For more information, see SuiteScript 2.x Script Types. |
Module |
|
Methods and Properties |
|
Since |
2015.2 |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/error Module Script Samples.
//Add additional code
...
// Include this code in a server script that is not a user event script to create an error.SuiteScriptError object
var SScustom_error = error.create({
name: 'MY_ERROR_CODE',
message: 'my custom SuiteScriptError details',
notifyOff: false
});
...
//Add additional code