-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ja] Translate GPUUncapturedErrorEvent #23683
Open
mikecat
wants to merge
2
commits into
mdn:main
Choose a base branch
from
mikecat:translate-gpuuncapturederrorevent
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+139
−0
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
title: "GPUUncapturedErrorEvent: error プロパティ" | ||
slug: Web/API/GPUUncapturedErrorEvent/error | ||
l10n: | ||
sourceCommit: 89c435da452257b944b403cc9e45036fcb22590e | ||
--- | ||
|
||
{{APIRef("WebGPU API")}}{{SeeCompatTable}}{{SecureContext_Header}} | ||
|
||
{{domxref("GPUUncapturedErrorEvent")}} インターフェイスの読み取り専用プロパティ **`error`** は、エラーの詳細へのアクセスを提供する {{domxref("GPUError")}} オブジェクトのインスタンスです。 | ||
|
||
## 値 | ||
|
||
{{domxref("GPUError")}} オブジェクトのインスタンスです。 | ||
|
||
## 例 | ||
|
||
例は、メインの [`GPUUncapturedErrorEvent`](/ja/docs/Web/API/GPUUncapturedErrorEvent#例) のページを参照してください。 | ||
|
||
## 仕様書 | ||
|
||
{{Specifications}} | ||
|
||
## ブラウザーの互換性 | ||
|
||
{{Compat}} | ||
|
||
## 関連情報 | ||
|
||
- [WebGPU API](/ja/docs/Web/API/WebGPU_API) | ||
- [WebGPU Error Handling best practices](https://toji.dev/webgpu-best-practices/error-handling) |
50 changes: 50 additions & 0 deletions
50
files/ja/web/api/gpuuncapturederrorevent/gpuuncapturederrorevent/index.md
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,50 @@ | ||
--- | ||
title: "GPUUncapturedErrorEvent: GPUUncapturedErrorEvent() コンストラクター" | ||
slug: Web/API/GPUUncapturedErrorEvent/GPUUncapturedErrorEvent | ||
l10n: | ||
sourceCommit: 89c435da452257b944b403cc9e45036fcb22590e | ||
--- | ||
|
||
{{APIRef("WebGPU API")}}{{SeeCompatTable}}{{SecureContext_Header}} | ||
|
||
**`GPUUncapturedErrorEvent()`** コンストラクターは、新しい {{domxref("GPUUncapturedErrorEvent")}} オブジェクトのインスタンスを生成します。 | ||
|
||
## 構文 | ||
|
||
```js-nolint | ||
new GPUUncapturedErrorEvent(type, options) | ||
``` | ||
|
||
### 引数 | ||
|
||
- `type` | ||
- : エラーの種類を指定する列挙値です。以下の値のいずれかです。 | ||
- `"internal"` | ||
- : エラーは {{domxref("GPUInternalError")}} です。 | ||
- `"out-of-memory"` | ||
- : エラーは {{domxref("GPUOutOfMemoryError")}} です。 | ||
- `"validation"` | ||
- : エラーは {{domxref("GPUValidationError")}} です。 | ||
- `options` | ||
- : オブジェクトです。以下のプロパティを持つことができます。 | ||
- `error` | ||
- : エラーの詳細へのアクセスを提供する {{domxref("GPUError")}} オブジェクトのインスタンスです。 | ||
|
||
## 例 | ||
|
||
開発者は、自分でこのコンストラクターを用いて `GPUUncapturedErrorEvent` オブジェクトを生成することはないでしょう。ユーザーエージェントは、{{domxref("GPUDevice")}} の {{domxref("GPUDevice.uncapturederror_event", "uncapturederror")}} イベントが発火したとき、予期せぬエラーをキャプチャできるようにするため、このコンストラクターを用いて適切なオブジェクトを生成します。 | ||
|
||
例は、メインの [`GPUUncapturedErrorEvent`](/ja/docs/Web/API/GPUUncapturedErrorEvent#例) のページを参照してください。 | ||
|
||
## 仕様書 | ||
|
||
{{Specifications}} | ||
|
||
## ブラウザーの互換性 | ||
|
||
{{Compat}} | ||
|
||
## 関連情報 | ||
|
||
- [WebGPU API](/ja/docs/Web/API/WebGPU_API) | ||
- [WebGPU Error Handling best practices](https://toji.dev/webgpu-best-practices/error-handling) |
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,58 @@ | ||
--- | ||
title: GPUUncapturedErrorEvent | ||
slug: Web/API/GPUUncapturedErrorEvent | ||
l10n: | ||
sourceCommit: 89c435da452257b944b403cc9e45036fcb22590e | ||
--- | ||
|
||
{{APIRef("WebGPU API")}}{{SeeCompatTable}}{{SecureContext_Header}} | ||
|
||
{{domxref("WebGPU API", "WebGPU API", "", "nocode")}} の **`GPUUncapturedErrorEvent`** インターフェイスは、{{domxref("GPUDevice")}} の {{domxref("GPUDevice.uncapturederror_event", "uncapturederror")}} イベント用のイベントオブジェクト型で、テレメトリーや予期せぬエラーの報告に使用されます。 | ||
|
||
エラーが発生する可能性を把握している場合は、{{domxref("GPUDevice.pushErrorScope", "pushErrorScope()")}} および {{domxref("GPUDevice.popErrorScope", "popErrorScope()")}} を用いて処理をするべきです。 | ||
|
||
{{InheritanceDiagram}} | ||
|
||
## コンストラクター | ||
|
||
- {{domxref("GPUUncapturedErrorEvent.GPUUncapturedErrorEvent", "GPUUncapturedErrorEvent()")}} {{Experimental_Inline}} | ||
- : 新しい `GPUUncapturedErrorEvent` オブジェクトのインスタンスを生成します。 | ||
|
||
## インスタンスプロパティ | ||
|
||
_親の {{domxref("Event")}} からプロパティを継承します。_ | ||
|
||
- {{domxref("GPUUncapturedErrorEvent.error", "error")}} {{Experimental_Inline}} {{ReadOnlyInline}} | ||
- : エラーの詳細へのアクセスを提供する {{domxref("GPUError")}} オブジェクトのインスタンスです。 | ||
|
||
## 例 | ||
|
||
エラースコープで処理されなかったエラーをすべて拾ってキャプチャするグローバルな仕組みとして、以下のようなコードを使用できます。 | ||
|
||
```js | ||
// ... | ||
|
||
device.addEventListener("uncapturederror", (event) => { | ||
// エラーを再浮上させる | ||
console.error("WebGPU エラーがキャプチャされませんでした:", event.error.message); | ||
reportErrorToServer({ | ||
type: event.error.constructor.name, | ||
message: event.error.message, | ||
}); | ||
}); | ||
|
||
// ... | ||
``` | ||
|
||
## 仕様書 | ||
|
||
{{Specifications}} | ||
|
||
## ブラウザーの互換性 | ||
|
||
{{Compat}} | ||
|
||
## 関連情報 | ||
|
||
- [WebGPU API](/ja/docs/Web/API/WebGPU_API) | ||
- [WebGPU Error Handling best practices](https://toji.dev/webgpu-best-practices/error-handling) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[mdn-linter] reported by reviewdog 🐶