Modules

filter

 

Objects/Functions

module (N/error)

SuiteScript 2.0

error.SuiteScriptError

// Please search https://system.netsuite.com/app/help/helpcenter.nl?search=error.SuiteScriptError for more information.

N/error Module
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. The error.create(options) method returns error.SuiteScriptError when it is called in any server script that is not a user event script. For a complete list of this object’s methods and properties, see SuiteScriptError Object Members.
Supported Script Types: All server scripts that are not user event scripts. For more information, see SuiteScript 2.0 Script Types.
Module: N/error Module
Since: 2015.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=error.SuiteScriptError

Example:

// Code Example 1
//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

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4253432660.html