---
schema_version: "1"
id: aabb419f31ef2e781154b3b62666affe3e84ac3117faab1d3c0cb8c229e60d8c
title: getError()
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_connectapi_output_batch_result_get_error.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_output_batch_result_get_error.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: abce9bc3b35a687eebc9dd25032128a8d8d619a4f5048cea0ec55ca348ddc4a9
description: If an error occurred, returns a ConnectApi.ConnectApiException object providing the error code and description.
---
# getError()

If an error occurred, returns a ConnectApi.ConnectApiException object providing the error code and description.

## Signature

public ConnectApi.ConnectApiException getError()

## Return Value

Type: [ConnectApi.ConnectApiException](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/connectAPI_exceptions.htm#connectAPI_exceptions "The ConnectApi namespace contains exception classes.")