mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibWeb/Streams: Use MUST_OR_THROW_OOM() when creating JS exceptions
This cannot throw unless we OOM.
This commit is contained in:
@@ -84,7 +84,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<JS::Promise>> ReadableStreamDefaultReader::
|
||||
|
||||
// 1. If this.[[stream]] is undefined, return a promise rejected with a TypeError exception.
|
||||
if (!m_stream) {
|
||||
auto exception = TRY(JS::TypeError::create(realm, "Cannot read from an empty stream"sv));
|
||||
auto exception = MUST_OR_THROW_OOM(JS::TypeError::create(realm, "Cannot read from an empty stream"sv));
|
||||
auto promise_capability = WebIDL::create_rejected_promise(realm, exception);
|
||||
return JS::NonnullGCPtr { verify_cast<JS::Promise>(*promise_capability->promise()) };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user