blob: e9f2a2ff51c7b9e52f73afe9b497a01e8d1a960f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
---
title: PromiseRejectionEvent.reason
slug: Web/API/PromiseRejectionEvent/reason
tags:
- API
- HTML DOM
- JavaScript
- PromiseRejectionEvent
- Promises
- Property
- Reference
- events
- reason
translation_of: Web/API/PromiseRejectionEvent/reason
---
<p>{{APIRef("HTML DOM")}}</p>
<p>{{domxref("PromiseRejectionEvent")}}の <strong><code>reason</code></strong> 読み取り専用プロパティは、{{jsxref("Promise.reject()")}} に渡される理由を提供する任意の JavaScript 値、または {{jsxref("Object")}} です。理論的には promise が拒否された理由についての情報を提供します。</p>
<h2 id="Syntax" name="Syntax">構文</h2>
<pre class="syntaxbox"><em>reason</em> = <em>PromiseRejectionEvent</em>.reason</pre>
<h3 id="Value" name="Value">値</h3>
<p>なぜ Promise が拒否されたかを理解するのに使う情報を提供する値またはオブジェクト。これはテキスト、リンク、その他ほしいものをつけた、エラーコードからオブジェクトなんでもありえます。</p>
<h2 id="Examples" name="Examples">例</h2>
<pre class="brush: js">window.onunhandledrejection = function(e) {
console.log(e.reason);
}</pre>
<h2 id="Specifications" name="Specifications">仕様</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">仕様</th>
<th scope="col">ステータス</th>
<th scope="col">コメント</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('HTML WHATWG', 'webappapis.html#dom-promiserejectionevent-reason', 'PromiseRejectionEvent.reason')}}</td>
<td>{{ Spec2('HTML WHATWG') }}</td>
<td>初期定義。</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザー実装状況</h2>
<p>{{Compat("api.PromiseRejectionEvent.reason")}}</p>
<h2 id="See_also" name="See_also">関連情報</h2>
<ul>
<li>{{jsxref("Promise")}}</li>
<li>{{domxref("PromiseRejectionEvent")}}</li>
<li>{{event("rejectionhandled")}}</li>
<li>{{event("unhandledrejection")}}</li>
</ul>
|