Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(775)

Unified Diff: third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp

Issue 2439673002: [Fetch API] Streaming error should be reported as a TypeError (Closed)
Patch Set: fix Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/stream-reader.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp b/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp
index 923e6720a3f5af256beb66c474c13190d1e4267e..bd4a4dfcfa9dc8c685128bd2574425beb071c3de 100644
--- a/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp
+++ b/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp
@@ -6,6 +6,7 @@
#include "bindings/core/v8/ScriptState.h"
#include "bindings/core/v8/V8HiddenValue.h"
+#include "bindings/core/v8/V8ThrowException.h"
#include "core/dom/DOMArrayBuffer.h"
#include "core/dom/DOMTypedArray.h"
#include "core/dom/ExceptionCode.h"
@@ -285,7 +286,11 @@ void BodyStreamBuffer::close() {
}
void BodyStreamBuffer::error() {
- controller()->error(DOMException::create(NetworkError, "network error"));
+ {
+ ScriptState::Scope scope(m_scriptState.get());
+ controller()->error(V8ThrowException::createTypeError(
+ m_scriptState->isolate(), "network error"));
+ }
cancelConsumer();
}
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/fetch/script-tests/stream-reader.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698