1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:48:10 +00:00

LibWeb: Propogate OOM errors from readable_stream_reader_generic_cancel

This commit is contained in:
Matthew Olsson 2023-04-13 16:46:31 -07:00 committed by Linus Groh
parent f9d6a161e8
commit db1be40b13
3 changed files with 4 additions and 4 deletions

View file

@ -242,7 +242,7 @@ void readable_stream_add_read_request(ReadableStream& stream, ReadRequest const&
}
// https://streams.spec.whatwg.org/#readable-stream-reader-generic-cancel
JS::NonnullGCPtr<WebIDL::Promise> readable_stream_reader_generic_cancel(ReadableStreamGenericReaderMixin& reader, JS::Value reason)
WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::Promise>> readable_stream_reader_generic_cancel(ReadableStreamGenericReaderMixin& reader, JS::Value reason)
{
// 1. Let stream be reader.[[stream]]
auto stream = reader.stream();
@ -251,7 +251,7 @@ JS::NonnullGCPtr<WebIDL::Promise> readable_stream_reader_generic_cancel(Readable
VERIFY(stream);
// 3. Return ! ReadableStreamCancel(stream, reason)
return MUST(readable_stream_cancel(*stream, reason));
return TRY(readable_stream_cancel(*stream, reason));
}
// https://streams.spec.whatwg.org/#readable-stream-reader-generic-initialize