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

Unified Diff: Source/modules/indexeddb/IDBKeyRange.cpp

Issue 18580013: IndexedDB: Make DOMException messages more useful. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Specific message for inactive transactions Created 7 years, 5 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/indexeddb/IDBIndex.cpp ('k') | Source/modules/indexeddb/IDBObjectStore.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/indexeddb/IDBKeyRange.cpp
diff --git a/Source/modules/indexeddb/IDBKeyRange.cpp b/Source/modules/indexeddb/IDBKeyRange.cpp
index e01303db88d66731fa17ff0e1faab117167ac973..f646387a2a3dc3acee7ea3d1f8fdf05b9b864c29 100644
--- a/Source/modules/indexeddb/IDBKeyRange.cpp
+++ b/Source/modules/indexeddb/IDBKeyRange.cpp
@@ -30,6 +30,7 @@
#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/IDBBindingUtilities.h"
#include "core/dom/ExceptionCode.h"
+#include "modules/indexeddb/IDBDatabase.h"
#include "modules/indexeddb/IDBKey.h"
namespace WebCore {
@@ -65,7 +66,7 @@ PassRefPtr<IDBKeyRange> IDBKeyRange::only(PassRefPtr<IDBKey> prpKey, ExceptionSt
{
RefPtr<IDBKey> key = prpKey;
if (!key || !key->isValid()) {
- es.throwDOMException(DataError);
+ es.throwDOMException(DataError, IDBDatabase::notValidKeyErrorMessage);
return 0;
}
@@ -77,7 +78,7 @@ PassRefPtr<IDBKeyRange> IDBKeyRange::only(ScriptExecutionContext* context, const
DOMRequestState requestState(context);
RefPtr<IDBKey> key = scriptValueToIDBKey(&requestState, keyValue);
if (!key || !key->isValid()) {
- es.throwDOMException(DataError);
+ es.throwDOMException(DataError, IDBDatabase::notValidKeyErrorMessage);
return 0;
}
@@ -89,7 +90,7 @@ PassRefPtr<IDBKeyRange> IDBKeyRange::lowerBound(ScriptExecutionContext* context,
DOMRequestState requestState(context);
RefPtr<IDBKey> bound = scriptValueToIDBKey(&requestState, boundValue);
if (!bound || !bound->isValid()) {
- es.throwDOMException(DataError);
+ es.throwDOMException(DataError, IDBDatabase::notValidKeyErrorMessage);
return 0;
}
@@ -101,7 +102,7 @@ PassRefPtr<IDBKeyRange> IDBKeyRange::upperBound(ScriptExecutionContext* context,
DOMRequestState requestState(context);
RefPtr<IDBKey> bound = scriptValueToIDBKey(&requestState, boundValue);
if (!bound || !bound->isValid()) {
- es.throwDOMException(DataError);
+ es.throwDOMException(DataError, IDBDatabase::notValidKeyErrorMessage);
return 0;
}
@@ -115,15 +116,15 @@ PassRefPtr<IDBKeyRange> IDBKeyRange::bound(ScriptExecutionContext* context, cons
RefPtr<IDBKey> upper = scriptValueToIDBKey(&requestState, upperValue);
if (!lower || !lower->isValid() || !upper || !upper->isValid()) {
- es.throwDOMException(DataError);
+ es.throwDOMException(DataError, IDBDatabase::notValidKeyErrorMessage);
return 0;
}
if (upper->isLessThan(lower.get())) {
- es.throwDOMException(DataError);
+ es.throwDOMException(DataError, "The lower key is greater than the upper key.");
return 0;
}
if (upper->isEqual(lower.get()) && (lowerOpen || upperOpen)) {
- es.throwDOMException(DataError);
+ es.throwDOMException(DataError, "The lower key and upper key are equal and one of the bounds is open.");
return 0;
}
« no previous file with comments | « Source/modules/indexeddb/IDBIndex.cpp ('k') | Source/modules/indexeddb/IDBObjectStore.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698