Skip to content

Commit 020487e

Browse files
Specify the error code for failures when reading a value from disk (#430)
* Specify NotReadableError for read failures arising from the underlying storage * Address review comments * Specify return types of the algorithms instead * Update the Revision History and Acknowledgements sections
1 parent 010ecb2 commit 020487e

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

index.bs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,6 +1866,13 @@ usage.
18661866
not be found.
18671867
</td>
18681868
</tr>
1869+
<tr>
1870+
<td>{{NotReadableError}}</td>
1871+
<td>
1872+
The operation failed because the underlying storage containing
1873+
the requested data could not be read.
1874+
</td>
1875+
</tr>
18691876
<tr>
18701877
<td>{{QuotaExceededError}}</td>
18711878
<td>
@@ -1892,8 +1899,8 @@ usage.
18921899
<tr>
18931900
<td>{{UnknownError}}</td>
18941901
<td>
1895-
The operation failed for reasons unrelated to the database
1896-
itself and not covered by any other errors.
1902+
The operation failed for transient reasons unrelated to the
1903+
database itself or not covered by any other error.
18971904
</td>
18981905
</tr>
18991906
<tr>
@@ -5634,15 +5641,17 @@ To <dfn>store a record into an object store</dfn> with
56345641
<div algorithm>
56355642

56365643
To <dfn>retrieve a value from an object store</dfn> with
5637-
|targetRealm|, |store| and |range|, run these steps:
5644+
|targetRealm|, |store| and |range|, run these steps.
5645+
They return undefined, an ECMAScript value, or an error (a {{DOMException}}):
56385646

56395647
1. Let |record| be the first [=object-store/record=] in |store|'s
56405648
[=object-store/list of records=] whose [=/key=] is [=in=] |range|, if
56415649
any.
56425650

56435651
1. If |record| was not found, return undefined.
56445652

5645-
1. Let |serialized| be of |record|'s [=/value=].
5653+
1. Let |serialized| be |record|'s [=/value=]. If an error occurs while reading the value from the
5654+
underlying storage, return a newly [=exception/created=] "{{NotReadableError}}" {{DOMException}}.
56465655

56475656
1. Return [=ECMAScript/!=] [$StructuredDeserialize$](|serialized|, |targetRealm|).
56485657

@@ -5652,7 +5661,8 @@ To <dfn>retrieve a value from an object store</dfn> with
56525661
<div algorithm>
56535662

56545663
To <dfn>retrieve multiple values from an object
5655-
store</dfn> with |targetRealm|, |store|, |range| and optional |count|, run these steps:
5664+
store</dfn> with |targetRealm|, |store|, |range| and optional |count|, run these steps.
5665+
They return a <code>[=/sequence=]&lt;{{any}}&gt;</code> or an error (a {{DOMException}}):
56565666

56575667
1. If |count| is not given or is 0 (zero), let |count| be infinity.
56585668

@@ -5664,7 +5674,8 @@ store</dfn> with |targetRealm|, |store|, |range| and optional |count|, run these
56645674

56655675
1. [=list/For each=] |record| of |records|:
56665676

5667-
1. Let |serialized| be |record|'s [=/value=].
5677+
1. Let |serialized| be |record|'s [=/value=]. If an error occurs while reading the value from the
5678+
underlying storage, return a newly [=exception/created=] "{{NotReadableError}}" {{DOMException}}.
56685679
1. Let |entry| be [=ECMAScript/!=] [$StructuredDeserialize$](|serialized|, |targetRealm|).
56695680
1. Append |entry| to |list|.
56705681

@@ -6706,6 +6717,7 @@ For the revision history of the second edition, see [that document's Revision Hi
67066717
* Added <a href="#accessibility">Accessibility considerations</a> section. ([Issue #327](https://github.com/w3c/IndexedDB/issues/327))
67076718
* Used [[infra]]'s list sorting definition. ([Issue #346](https://github.com/w3c/IndexedDB/issues/346))
67086719
* Added a definition for [=transaction/live=] transactions, and renamed "run an upgrade transaction" to [=/upgrade a database=], to disambiguate "running". ([Issue #408](https://github.com/w3c/IndexedDB/issues/408))
6720+
* Specified the {{DOMException}} type for failures when reading a value from the underlying storage in [[#object-store-retrieval-operation]]. ([Issue #423](https://github.com/w3c/IndexedDB/issues/423))
67096721

67106722
<!-- ============================================================ -->
67116723
# Acknowledgements # {#acknowledgements}
@@ -6725,6 +6737,7 @@ specification authoring tool used to create this document, and
67256737
for his general authoring advice.
67266738

67276739
Special thanks to
6740+
Abhishek Shanthkumar,
67286741
Adam Klein,
67296742
Addison Phillips,
67306743
Adrienne Walker,

0 commit comments

Comments
 (0)