Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add status code to service worker registration failure message
This helps developer understand why the service worker fails to register Error message: "Service worker registration failed. Status code: <code>", e.g. "Service worker registration failed. Status code: 18" R=lazyboy@chromium.org, rdevlin.cronin@chromium.org Bug: 1348391 Change-Id: I3a3af5056909593c57fe09f8396599aa2d43cd07 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3805456 Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org> Commit-Queue: Richard Zhang <richardzh@chromium.org> Cr-Commit-Position: refs/heads/main@{#1032240}
- Loading branch information
Richard Zhang
authored and
Chromium LUCI CQ
committed
Aug 6, 2022
1 parent
e329343
commit 890efcd
Showing
4 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
.../service_worker/worker_based_background/service_worker_registration_failure/manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "Service Worker-based background script", | ||
"version": "0.1", | ||
"manifest_version": 3, | ||
"description": "Test a service script that throws error.", | ||
"background": { | ||
"service_worker": "service_worker_background.js" | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
.../worker_based_background/service_worker_registration_failure/service_worker_background.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Copyright 2022 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
throw new Error('lol'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters