From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../api/promiserejectionevent/reason/index.html | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 files/ja/web/api/promiserejectionevent/reason/index.html (limited to 'files/ja/web/api/promiserejectionevent/reason') diff --git a/files/ja/web/api/promiserejectionevent/reason/index.html b/files/ja/web/api/promiserejectionevent/reason/index.html new file mode 100644 index 0000000000..e9f2a2ff51 --- /dev/null +++ b/files/ja/web/api/promiserejectionevent/reason/index.html @@ -0,0 +1,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 +--- +

{{APIRef("HTML DOM")}}

+ +

{{domxref("PromiseRejectionEvent")}}の reason 読み取り専用プロパティは、{{jsxref("Promise.reject()")}} に渡される理由を提供する任意の JavaScript 値、または {{jsxref("Object")}} です。理論的には promise が拒否された理由についての情報を提供します。

+ +

構文

+ +
reason = PromiseRejectionEvent.reason
+ +

+ +

なぜ Promise が拒否されたかを理解するのに使う情報を提供する値またはオブジェクト。これはテキスト、リンク、その他ほしいものをつけた、エラーコードからオブジェクトなんでもありえます。

+ +

+ +
window.onunhandledrejection = function(e) {
+  console.log(e.reason);
+}
+ +

仕様

+ + + + + + + + + + + + + + + + +
仕様ステータスコメント
{{SpecName('HTML WHATWG', 'webappapis.html#dom-promiserejectionevent-reason', 'PromiseRejectionEvent.reason')}}{{ Spec2('HTML WHATWG') }}初期定義。
+ +

ブラウザー実装状況

+ + + +

{{Compat("api.PromiseRejectionEvent.reason")}}

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf