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 2 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
23 changes: 19 additions & 4 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 @@ -5636,13 +5643,17 @@ To <dfn>store a record into an object store</dfn> with
To <dfn>retrieve a value from an object store</dfn> with
|targetRealm|, |store| and |range|, run these steps:

NOTE:
May return a {{DOMException}} if an error occurs while running these steps.
abhishek-shanthkumar marked this conversation as resolved.
Show resolved Hide resolved

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 @@ -5654,6 +5665,9 @@ To <dfn>retrieve a value from an object store</dfn> with
To <dfn>retrieve multiple values from an object
store</dfn> with |targetRealm|, |store|, |range| and optional |count|, run these steps:

NOTE:
abhishek-shanthkumar marked this conversation as resolved.
Show resolved Hide resolved
May return a {{DOMException}} if an error occurs while running these steps.

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

1. Let |records| be a [=/list=] containing the first |count| [=object-store/records=]
Expand All @@ -5664,7 +5678,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
Loading