---
schema_version: "1"
id: 5d578cf15692b4541f75f625b61f4e7bf6e54646f4823c64986aefb623a5974f
title: reportError()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/aura-platform/guides/aura/ref-jsapi/ref-jsapi-dollara-reporterror.md
canonical_url: https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-dollara-reporterror.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0c9697242bfa861a98d765815b2b1e30923d40e642f56ef4b56bdb4efd8455be
products:
  - Lightning Aura Components Developer Guide
  - Platform Developer Content
---

# reportError()

Report an error to the server after handling it. Note that the method should be used only if the try-catch mechanism of error handling is not desired or not functional, such as in nested promises.

## Signature

`reportError (String message, Error error)`

## Parameters

**_message_:** Type: `String`. The error message.

**_error_:** Type: `Error`. An error object to be included in handling and reporting.

