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

Issue 18580013: IndexedDB: Make DOMException messages more useful. (Closed)

Created:
7 years, 5 months ago by jsbell
Modified:
7 years, 5 months ago
CC:
blink-reviews, dgrogan, eae+blinkwatch, dglazkov+blink, alecflett, arv (Not doing code reviews)
Visibility:
Public.

Description

IndexedDB: Make DOMException messages more useful. IndexedDB throws a handful of DOMException types for a wide variety of reasons; IDBObjectStore.put() has 6 cases that throw DataError. Show web developers a little love by giving specific messages for each error cases. In most cases the error text is inspired by the IndexedDB specification itself. BUG=95723 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=154140

Patch Set 1 #

Patch Set 2 : Disambiguate TransactionInactiveError #

Total comments: 8

Patch Set 3 : Remove unused message #

Patch Set 4 : Message => ErrorMessage #

Total comments: 7

Patch Set 5 : Review feedback #

Patch Set 6 : Specific message for inactive transactions #

Unified diffs Side-by-side diffs Delta from patch set Stats (+228 lines, -89 lines) Patch
M Source/modules/indexeddb/IDBCursor.cpp View 1 2 3 4 5 7 chunks +57 lines, -16 lines 0 comments Download
M Source/modules/indexeddb/IDBDatabase.h View 1 2 3 4 5 1 chunk +13 lines, -1 line 0 comments Download
M Source/modules/indexeddb/IDBDatabase.cpp View 1 2 3 4 5 6 chunks +38 lines, -13 lines 0 comments Download
M Source/modules/indexeddb/IDBFactory.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/indexeddb/IDBIndex.cpp View 1 2 3 4 5 5 chunks +32 lines, -12 lines 0 comments Download
M Source/modules/indexeddb/IDBKeyRange.cpp View 1 2 3 6 chunks +8 lines, -7 lines 0 comments Download
M Source/modules/indexeddb/IDBObjectStore.cpp View 1 2 3 4 5 14 chunks +73 lines, -33 lines 0 comments Download
M Source/modules/indexeddb/IDBRequest.cpp View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M Source/modules/indexeddb/IDBTransaction.cpp View 1 2 3 3 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
jsbell
I put all of the re-used messages in IDBDatabase. I could make them more scoped ...
7 years, 5 months ago (2013-07-12 17:33:45 UTC) #1
arv (Not doing code reviews)
LGTM with nits https://codereview.chromium.org/18580013/diff/2001/Source/modules/indexeddb/IDBCursor.cpp File Source/modules/indexeddb/IDBCursor.cpp (right): https://codereview.chromium.org/18580013/diff/2001/Source/modules/indexeddb/IDBCursor.cpp#newcode130 Source/modules/indexeddb/IDBCursor.cpp:130: es.throwDOMException(InvalidStateError, IDBDatabase::notGotValueMessage); maybe didntGetValueErrorMessage or noValueErrorMessage? ...
7 years, 5 months ago (2013-07-12 17:43:08 UTC) #2
jsbell
https://codereview.chromium.org/18580013/diff/2001/Source/modules/indexeddb/IDBCursor.cpp File Source/modules/indexeddb/IDBCursor.cpp (right): https://codereview.chromium.org/18580013/diff/2001/Source/modules/indexeddb/IDBCursor.cpp#newcode130 Source/modules/indexeddb/IDBCursor.cpp:130: es.throwDOMException(InvalidStateError, IDBDatabase::notGotValueMessage); On 2013/07/12 17:43:08, arv wrote: > maybe ...
7 years, 5 months ago (2013-07-12 17:53:13 UTC) #3
dgrogan
lgtm Thanks for doing this. I look forward to seeing these show up on stackoverflow. ...
7 years, 5 months ago (2013-07-12 17:58:17 UTC) #4
arv (Not doing code reviews)
https://codereview.chromium.org/18580013/diff/2003/Source/modules/indexeddb/IDBDatabase.cpp File Source/modules/indexeddb/IDBDatabase.cpp (right): https://codereview.chromium.org/18580013/diff/2003/Source/modules/indexeddb/IDBDatabase.cpp#newcode208 Source/modules/indexeddb/IDBDatabase.cpp:208: es.throwDOMException(SyntaxError, "The keyPath option is not a valid key ...
7 years, 5 months ago (2013-07-12 18:07:29 UTC) #5
arv (Not doing code reviews)
Maybe we should change the test we have to also assert the exception message?
7 years, 5 months ago (2013-07-12 18:19:18 UTC) #6
jsbell
I'll re-do the TransactionInactiveError messages but leave including paths/names for a future CL. (And keep ...
7 years, 5 months ago (2013-07-12 18:22:19 UTC) #7
jsbell
On 2013/07/12 18:19:18, arv wrote: > Maybe we should change the test we have to ...
7 years, 5 months ago (2013-07-12 18:25:51 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jsbell@chromium.org/18580013/21001
7 years, 5 months ago (2013-07-12 18:33:18 UTC) #9
commit-bot: I haz the power
7 years, 5 months ago (2013-07-12 20:54:27 UTC) #10
Message was sent while issue was closed.
Change committed as 154140

Powered by Google App Engine
This is Rietveld 408576698