---
schema_version: "1"
id: 93a8349ecbb0227be3dc18a816c7ad038a597217f562d470da093cc1e7aca63a
title: error()
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-error.md
canonical_url: https://developer.salesforce.com/docs/platform/aura-platform/guide/ref-jsapi-dollara-error.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 006dd980639025a974a1ae2b23f25c6aaa878d2af45bd9bef09fff52176bfe31
products:
  - Lightning Aura Components Developer Guide
  - Platform Developer Content
---

# error()

Deprecated. For a serious error that has no recovery path, throw a standard JavaScript error instead by using `throw new Error(msg)`.

## Signature

`error (String msg, Error e)`

## Parameters

**_msg_:** Type: `String`. The error message to display to the user.

**_e_:** Type: `Error`. The error message to display to the user.

