---
schema_version: "1"
id: 9f844e52dafd1fd70c4d96b74d7ccedb8ef14b8dd7eb37f893c3a886c8b43ba8
title: getErrorMessage()
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_message.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_connectapi_output_batch_result_get_error_message.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: ec4c21450ab403d6a949a2d98df1da41601a2f985110d6e70fa55d8c56b9c6bc
description: Returns a String that contains an error message.
---
# getErrorMessage()

Returns a String that contains an error message.

## Signature

public String getErrorMessage()

## Return Value

Type: String

## Usage

The error message doesn’t make a round trip through a Visualforce view state, because exceptions can’t be serialized.