Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify the error code for failures when reading a value from disk #430

Merged
merged 4 commits into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1866,6 +1866,13 @@ usage.
not be found.
</td>
</tr>
<tr>
<td>{{NotReadableError}}</td>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth mentioning that this is considered a "permanent" loss or that the data is "irrecoverable"?

(Sorry for late review)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'll update this in a follow-up PR.

<td>
The operation failed because the underlying storage containing
the requested data could not be read.
</td>
</tr>
<tr>
<td>{{QuotaExceededError}}</td>
<td>
Expand All @@ -1892,8 +1899,8 @@ usage.
<tr>
<td>{{UnknownError}}</td>
<td>
The operation failed for reasons unrelated to the database
itself and not covered by any other errors.
The operation failed for transient reasons unrelated to the
database itself or not covered by any other error.
</td>
</tr>
<tr>
Expand Down Expand Up @@ -5634,15 +5641,17 @@ To <dfn>store a record into an object store</dfn> with
<div algorithm>

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

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

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

1. Let |serialized| be of |record|'s [=/value=].
1. Let |serialized| be |record|'s [=/value=]. If an error occurs while reading the value from the
abhishek-shanthkumar marked this conversation as resolved.
Show resolved Hide resolved
underlying storage, return a newly [=exception/created=] "{{NotReadableError}}" {{DOMException}}.

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

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

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

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

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

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

1. Let |serialized| be |record|'s [=/value=].
1. Let |serialized| be |record|'s [=/value=]. If an error occurs while reading the value from the
abhishek-shanthkumar marked this conversation as resolved.
Show resolved Hide resolved
underlying storage, return a newly [=exception/created=] "{{NotReadableError}}" {{DOMException}}.
1. Let |entry| be [=ECMAScript/!=] [$StructuredDeserialize$](|serialized|, |targetRealm|).
1. Append |entry| to |list|.

Expand Down Expand Up @@ -6706,6 +6717,7 @@ For the revision history of the second edition, see [that document's Revision Hi
* Added <a href="#accessibility">Accessibility considerations</a> section. ([Issue #327](https://github.com/w3c/IndexedDB/issues/327))
* Used [[infra]]'s list sorting definition. ([Issue #346](https://github.com/w3c/IndexedDB/issues/346))
* 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))
* 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))

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

Special thanks to
Abhishek Shanthkumar,
Adam Klein,
Addison Phillips,
Adrienne Walker,
Expand Down
Loading