Common Error Messages for Lightning Experience Methods

An error object is returned as an array for all Lightning Experience methods.

The following fields are contained as part of the error object.

code: {string}

A constant string denoting an error code.

description: {string}

A description of the error code.

details: {object}

Typically undefined. This constant can contain details about the error object for the saveLog method.

Sample error object:

1[{
2   code: code1
3   description: description1
4   details: details1
5   },{
6   code: code2
7   description: description2
8   details: details2
9}]

Sample error object for the INVALID_PARAM error code:

1[{
2   code: "INVALID_PARAM",
3   description: "An invalid value was passed to the parameter PARAMETERNAME. A numeric value was expected, but UNDEFINED was found instead."
4}]

Sample error object for the GENERIC_PARAM error code:

1[{
2   code: "GENERIC_ERROR",
3   description: "An error occurred while calling the API method."
4}]

Sample error object for the SERVER_ERROR code:

1[{
2   code: "SERVER_ERROR",
3   description: "A problem was encountered on the server."
4}]

Sample error object for the SOFTPHONE_CONTAINER_ERROR code:

1[{
2   code: "SOFTPHONE_CONTAINER_ERROR",
3   description: "Unable to execute sendPostMessage because the softphone container hasn’t initialized yet."
4}]

For the runApex method, if there is a server error, the description field provides "Could not load Apex class: apexClassName."

For the saveLog method, the details field provides information based on the type of error. For example:

1[{
2   code:"GENERIC_ERROR",
3   description:"An error occurred while calling the saveLog() API method. Review the Details field in the error section.",
4   details:[{
5         message:"An error occurred while trying to update the record. Please try again.",
6         pageErrors:[],
7         fieldErrors:{
8            Name:[{
9                  statusCode:"REQUIRED_FIELD_MISSING",
10                  message:"Required fields are missing: [Name]",
11                  fieldLabel:"Account Name",
12                  columnApiName:"Name"
13               }]
14            },
15         potentialDuplicates:[]
16      }]
17}]