N/error Module
The content in this help topic pertains to SuiteScript 2.0.
Use the N/error module to create your own custom SuiteScript errors. Use these custom errors in try-catch statements to abort script execution. This module does not provide functionality to throw custom errors, however, your script can include logic to throw custom SuiteScript errors after they are created.
In This Help Topic
For more information about additional error logging capabilities, see the N/log Module.
N/error Module Members
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Object |
Object |
Server scripts that are not user event scripts |
Encapsulates a custom SuiteScript error for any server script type that is not a user event script. |
|
Method |
Server scripts |
Creates a new error.SuiteScriptError object. |
||
Enum |
enum |
Server scripts |
Holds the string values for error types. |
SuiteScriptError Object Members
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Property |
string (read-only) |
Server scripts that are not user event scripts |
Cause of the error. |
|
string (read-only) |
Server scripts that are not user event scripts |
Error ID that is automatically generated when a new error is created. |
||
string (read-only) |
Server scripts that are not user event scripts |
Error message text displayed in the Details column of the Execution Log. |
||
string (read-only) |
Server scripts that are not user event scripts |
User-defined error code. |
||
boolean (read-only) |
Server scripts that are not user event scripts |
Suppresses email notification when set to true. |
||
Array of strings (read-only) |
Server scripts that are not user event scripts |
List of method calls that the script is executing when the error is thrown. |
||
error.Type (read-only) |
Server scripts that are not user event scripts |
Error types. |