PackagePushError

Represents an error encountered during a push request. The number of PackagePushError records created depends on the number of push jobs in the request that result in an error.

Supported Calls

describeSObjects(), query(), retrieve()

Special Access Rules

To initiate a push upgrade for a first-generation managed package, the Upload AppExchange Packages user permission is required.

To initiate a push upgrade for an unlocked or second-generation managed package, the Create and Update Second-Generation Packages user permission is required.

The push upgrade feature is only available to first- and second-generation managed packages that have passed AppExchange security review. To enable push upgrades for your managed package, log a support case in the Salesforce Partner Community.

For unlocked packages, push upgrades are enabled by default.

Fields

Field Name Details
ErrorDetails
Type
string
Properties
Nillable, Sort
Description
Explanation of the error.
ErrorMessage
Type
string
Properties
Nillable, Sort
Description
The error code that appears in the API.
ErrorSeverity
Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
Valid values are:
  • Error
  • Warning
ErrorTitle
Type
string
Properties
Nillable, Sort
Description
The error message title that appears in the API.
ErrorType
Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
Valid values are:
  • ApexTestFailure
  • DeployError
  • FeatureMissing
  • IneligibleUpgrade
  • LimitExceeded
  • LockingFailure
  • PACError
  • UnclassifiedError
PackagePushJobId
Type
reference
Properties
Filter, Group, Nillable, Sort
Description
Required. The parent push job record ID.

Usage

Suppose that your push upgrade request wasn’t successful due to some of its jobs failing. Let’s write some code to find out what those errors were.

This code sample uses the Web Services Connector (WSC).
// Retrieves all PackagePushError objects associated with the PackagePushJob with the given
// ID
final String PACKAGE_PUSH_ERROR_QUERY = "Select ErrorMessage, ErrorDetails, ErrorTitle,"  
+ " ErrorSeverity, ErrorType from PackagePushError where PackagePushJobId = '%s'";

// job is a PackagePushJob instance
QueryResult queryResult = conn.query(String.format(PACKAGE_PUSH_ERROR_QUERY, job.getId()));

StringBuilder errorMessages = new StringBuilder();
errorMessages.append("Errors for PackagePushJob [").append(job.getId()).append("]:")
	.append("\n");

// There can be multiple PackagePushErrors for a given PackagePushJob
for(SObject r : queryResult.getRecords()) {
	PackagePushError e = (PackagePushError) r;
	errorMessages.append("Title: ").append(e.getErrorTitle()).append("\n");
	errorMessages.append("Severity: ").append(e.getErrorSeverity()).append("\n");
	errorMessages.append("Type: ").append(e.getErrorType()).append("\n");
	errorMessages.append("Message: ").append(e.getErrorMessage()).append("\n");
	errorMessages.append("Details: ").append(e.getErrorDetails()).append("\n");
	errorMessages.append("\n");
}

String errors errorMessages.toString();