N/error Module

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

error.SuiteScriptError

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

error.create(options)

error.SuiteScriptError

Server scripts

Creates a new error.SuiteScriptError object.

Enum

error.Type

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

SuiteScriptError.cause

string (read-only)

Server scripts that are not user event scripts

Cause of the error.

SuiteScriptError.id

string (read-only)

Server scripts that are not user event scripts

Error ID that is automatically generated when a new error is created.

SuiteScriptError.message

string (read-only)

Server scripts that are not user event scripts

Error message text displayed in the Details column of the Execution Log.

SuiteScriptError.name

string (read-only)

Server scripts that are not user event scripts

User-defined error code.

SuiteScriptError.notifyOff

boolean (read-only)

Server scripts that are not user event scripts

Suppresses email notification when set to true.

SuiteScriptError.stack

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.

SuiteScriptError.type

error.Type (read-only)

Server scripts that are not user event scripts

Error types.

Related Topics

General Notices