aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/serviceworkercontainer/onerror/index.html
blob: 94f99754411e390630d1d85ff53db1bf3be258a3 (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
---
title: ServiceWorkerContainer.onerror
slug: Web/API/ServiceWorkerContainer/onerror
tags:
  - API
  - Experimental
  - Property
  - Reference
  - Service Workers
  - ServiceWorker
  - ServiceWorkerContainer
  - onerror
translation_of: Web/API/ServiceWorkerContainer/onerror
---
<p>{{APIRef("Service Workers API")}}{{ SeeCompatTable() }}</p>

<p><span class="seoSummary">{{domxref("ServiceWorkerContainer")}} インターフェイスの <code><strong>onerror</strong></code> プロパティは、関連するサービスワーカーで {{Event("error")}} イベントが発生するたびに発生するイベントハンドラーです。</span></p>

<h2 id="Syntax" name="Syntax">構文</h2>

<pre class="syntaxbox"><em>serviceWorkerContainer</em>.onerror = function(<em>errorevent</em>) { ... }</pre>

<h2 id="Example" name="Example"></h2>

<pre class="brush: js">navigator.serviceWorker.onerror = function(errorevent) {
  console.log(`受信したエラーメッセージ: ${errorevent.message}`);
}
</pre>

<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>

<div>


<p>{{Compat("api.ServiceWorkerContainer.onerror")}}</p>
</div>