Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2020年1月.
error() は ReadableStreamDefaultController インターフェイスのメソッドで、関連づけられたストリームとの今後のやり取りをエラーにします。
メモ: error() メソッドは複数回呼び出すことができ、ストリームが読み取り可能でないときに呼び出すことができます。
今後のやり取りを失敗させるエラー。
なし (undefined)。
ソースオブジェクトが ReadableStreamDefaultController ではないか、何らかの理由でストリームが読み取り可能ではありません。
仕様にある基になるプッシュソースと背圧サポートのある読み取り可能なストリームの例は、ReadablestreamDefaultController.desiredSize を使用してストリームがいっぱいになったことを手動で検出し、背圧を適用しています。 また、error() を使用して、依存しているシステムの別の部分に障害が発生した場合に手動でストリームのエラーをトリガーする良い例を示しています。
| Streams # rs-default-controller-error |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025年7月22日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.