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
saveLogmethod.
- : Typically undefined. This constant can contain details about the error object for the
Sample error object:
[{
code: code1
description: description1
details: details1
},{
code: code2
description: description2
details: details2
}]
Sample error object for the INVALID_PARAM error code:
[{
code: "INVALID_PARAM",
description: "An invalid value was passed to the parameter PARAMETERNAME. A numeric value was expected, but UNDEFINED was found instead."
}]
Sample error object for the GENERIC_PARAM error code:
[{
code: "GENERIC_ERROR",
description: "An error occurred while calling the API method."
}]
Sample error object for the SERVER_ERROR code:
[{
code: "SERVER_ERROR",
description: "A problem was encountered on the server."
}]
Sample error object for the SOFTPHONE_CONTAINER_ERROR code:
[{
code: "SOFTPHONE_CONTAINER_ERROR",
description: "Unable to execute sendPostMessage because the softphone container hasn’t initialized yet."
}]
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:
[{
code:"GENERIC_ERROR",
description:"An error occurred while calling the saveLog() API method. Review the Details field in the error section.",
details:[{
message:"An error occurred while trying to update the record. Please try again.",
pageErrors:[],
fieldErrors:{
Name:[{
statusCode:"REQUIRED_FIELD_MISSING",
message:"Required fields are missing: [Name]",
fieldLabel:"Account Name",
columnApiName:"Name"
}]
},
potentialDuplicates:[]
}]
}]