Baseline Widely available
Note: This feature is available in Web Workers.
The error()
method of the TransformStreamDefaultController
interface errors both sides of the stream. Any further interactions with it will fail with the given error message, and any chunks in the queue will be discarded.
reason
A string containing the error message to be returned on any further interaction with the stream.
None (undefined
).
In this example the error()
method is used when a chunk could not be transformed.
const transformContent = {
start() {
/* ⦠*/
},
async transform(chunk, controller) {
try {
chunk = await applyMyTransformation(chunk);
} catch (err) {
controller.error(`Unable to transform chunk: ${err}`);
}
// â¦
},
// â¦
};
Specifications Browser compatibility
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4