Newer Version Available

This content describes an older version of this product. View Latest

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()

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).
1// Retrieves all PackagePushError objects associated with the PackagePushJob with the given
2// ID
3final String PACKAGE_PUSH_ERROR_QUERY = "Select ErrorMessage, ErrorDetails, ErrorTitle,"  
4+ " ErrorSeverity, ErrorType from PackagePushError where PackagePushJobId = '%s'";
5
6// job is a PackagePushJob instance
7QueryResult queryResult = conn.query(String.format(PACKAGE_PUSH_ERROR_QUERY, job.getId()));
8
9StringBuilder errorMessages = new StringBuilder();
10errorMessages.append("Errors for PackagePushJob [").append(job.getId()).append("]:")
11	.append("\n");
12
13// There can be multiple PackagePushErrors for a given PackagePushJob
14for(SObject r : queryResult.getRecords()) {
15	PackagePushError e = (PackagePushError) r;
16	errorMessages.append("Title: ").append(e.getErrorTitle()).append("\n");
17	errorMessages.append("Severity: ").append(e.getErrorSeverity()).append("\n");
18	errorMessages.append("Type: ").append(e.getErrorType()).append("\n");
19	errorMessages.append("Message: ").append(e.getErrorMessage()).append("\n");
20	errorMessages.append("Details: ").append(e.getErrorDetails()).append("\n");
21	errorMessages.append("\n");
22}
23
24String errors errorMessages.toString();