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

Unified Diff: Source/modules/imagebitmap/ImageBitmapFactories.cpp

Issue 120063002: Improve modules' TypeError exception messages. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 6 years, 11 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 | « Source/modules/encoding/TextEncoder.cpp ('k') | Source/modules/indexeddb/IDBCursor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/imagebitmap/ImageBitmapFactories.cpp
diff --git a/Source/modules/imagebitmap/ImageBitmapFactories.cpp b/Source/modules/imagebitmap/ImageBitmapFactories.cpp
index ede9276047298944bb4a0cec063d16908760a43c..d7826414430073d666f3902134f2aff81bb53139 100644
--- a/Source/modules/imagebitmap/ImageBitmapFactories.cpp
+++ b/Source/modules/imagebitmap/ImageBitmapFactories.cpp
@@ -83,7 +83,7 @@ ScriptPromise ImageBitmapFactories::createImageBitmap(EventTarget* eventTarget,
ASSERT(eventTarget->toDOMWindow());
if (!image) {
- exceptionState.throwUninformativeAndGenericTypeError();
+ exceptionState.throwTypeError("The image element provided is invalid.");
return ScriptPromise();
}
if (!image->cachedImage()) {
@@ -123,7 +123,7 @@ ScriptPromise ImageBitmapFactories::createImageBitmap(EventTarget* eventTarget,
ASSERT(eventTarget->toDOMWindow());
if (!video) {
- exceptionState.throwUninformativeAndGenericTypeError();
+ exceptionState.throwTypeError("The video element provided is invalid.");
return ScriptPromise();
}
if (!video->player()) {
@@ -175,7 +175,7 @@ ScriptPromise ImageBitmapFactories::createImageBitmap(EventTarget* eventTarget,
ASSERT(eventTarget->toDOMWindow());
if (!canvas) {
- exceptionState.throwUninformativeAndGenericTypeError();
+ exceptionState.throwTypeError("The canvas element provided is invalid.");
return ScriptPromise();
}
if (!canvas->originClean()) {
@@ -230,7 +230,7 @@ ScriptPromise ImageBitmapFactories::createImageBitmap(EventTarget* eventTarget,
ScriptPromise ImageBitmapFactories::createImageBitmap(EventTarget* eventTarget, ImageData* data, int sx, int sy, int sw, int sh, ExceptionState& exceptionState)
{
if (!data) {
- exceptionState.throwUninformativeAndGenericTypeError();
+ exceptionState.throwTypeError("The ImageData provided is invalid.");
return ScriptPromise();
}
if (!sw || !sh) {
@@ -249,7 +249,7 @@ ScriptPromise ImageBitmapFactories::createImageBitmap(EventTarget* eventTarget,
ScriptPromise ImageBitmapFactories::createImageBitmap(EventTarget* eventTarget, ImageBitmap* bitmap, int sx, int sy, int sw, int sh, ExceptionState& exceptionState)
{
if (!bitmap) {
- exceptionState.throwUninformativeAndGenericTypeError();
+ exceptionState.throwTypeError("The ImageBitmap provided is invalid.");
return ScriptPromise();
}
if (!sw || !sh) {
« no previous file with comments | « Source/modules/encoding/TextEncoder.cpp ('k') | Source/modules/indexeddb/IDBCursor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698