No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
aura:systemError
エラーが発生したことを示します。
このイベントは、サーバ側のアクションの実行中にエラーが発生した場合に自動的に起動されます。aura:systemError イベントは、クライアント側のコントローラで処理されます。このイベントを処理するには、コンポーネントに <aura:handler event="aura:systemError"> タグを 1 つだけ指定します。
次の例に、エラーをトリガするボタンと、aura:systemError イベントのハンドラを示します。
1swfobject.registerObject("clippy.codeblock-0", "9");<aura:handler event="aura:systemError" action="{!c.handleError}"/>1swfobject.registerObject("clippy.codeblock-1", "9");<aura:component controller="namespace.myController">
2 <aura:handler event="aura:systemError" action="{!c.showSystemError}"/>
3 <aura:attribute name="response" type="Aura.Action"/>
4 <!-- Other component markup here -->
5 <ui:button aura:id="trigger" label="Trigger error" press="{!c.trigger}"/>
6</aura:component>次のクライアント側のコントローラは、エラーの起動をトリガし、そのエラーを処理します。
aura:systemError ハンドラには、次の必須属性があります。
1swfobject.registerObject("clippy.codeblock-2", "9");({
2 trigger: function(cmp, event) {
3 // Call an Apex controller that throws an error
4 var a = cmp.get("c.throwError");
5 a.setParams({
6 // Set any event parameters here
7 });
8 a.setCallback(cmp, function(action){
9 cmp.set("v.response", action);
10 });
11 $A.enqueueAction(a);
12 },
13
14 showSystemError: function(cmp, event) {
15 // Handle system error
16 $A.log(cmp);
17 $A.log(event);
18 }
19})| 属性名 | 型 | 説明 |
|---|---|---|
| event | String | イベント名。aura:systemError に設定する必要があります。 |
| action | Object | イベントを処理するクライアント側のコントローラアクション。 |
aura:systemError イベントには、次の属性があります。
| 属性名 | 型 | 説明 |
|---|---|---|
| message | String | event.getParam("message") から取得されるエラーメッセージ。 |
| error | Object | error オブジェクト。 |