System Error

aura:systemError

Indicates that an error has occurred.

This event is fired when an error is encountered during the execution of a server-side action. Handle this event using the aura:handler tag.

1<aura:handler event="aura:systemError" action="{!c.handleError}" />

This example shows a button that triggers an error and a handler for the aura:systemError event.

1<aura:component controller="myController">
2  <aura:handler event="aura:systemError" action="{!c.showSystemError}" />
3  <aura:attribute name="response" type="Aura.Action" />
4  <!-- Other component markup here -->
5  <lightning:button aura:id="trigger" label="Trigger error" onclick="{!c.trigger}" />
6</aura:component>

This client-side controller triggers the firing of an error and handles that error.

1({
2  trigger: function (cmp, event) {
3    // Call an Apex controller that throws an error
4    var action = cmp.get("c.throwError");
5    action.setCallback(cmp, function (response) {
6      cmp.set("v.response", response);
7    });
8    $A.enqueueAction(action);
9  },
10  showSystemError: function (cmp, event) {
11    // Handle system error
12  },
13});

Attributes 

NameDescriptionTypeDefaultRequired
errorThe system error that’s returned.string
messageThe message to be displayed during an error.string