Skip to content

Commit 194368e

Browse files
authored
Update QuotaExceededError usage
QuotaExceededError is graduating from being a DOMException name into a new error class, in whatwg/webidl#1465. Update creation sites to reflect this. For now, the quota and requested properties are left at their default (null). Future work could include setting them in an informative fashion.
1 parent cd7c444 commit 194368e

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

index.bs

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,12 +1807,11 @@ store.put(4); // will throw DataError
18071807
# Exceptions # {#exceptions}
18081808
<!-- ============================================================ -->
18091809

1810-
Each of the exceptions used in this document is a
1811-
{{DOMException}} with a specific type. The exception types and
1812-
properties such as legacy code value are defined in [[!WEBIDL]].
1810+
Each of the exceptions used in this document is a {{DOMException}}
1811+
or {{DOMException}}-derived interface, as defined in [[!WEBIDL]].
18131812

1814-
The table below lists the {{DOMException}}s used in this
1815-
document along with a description of the exception type's
1813+
The table below lists the {{DOMException}} names used in this
1814+
document along with a description of the exception's
18161815
usage.
18171816

18181817
<table class=props>
@@ -1868,14 +1867,6 @@ usage.
18681867
the requested data could not be read.
18691868
</td>
18701869
</tr>
1871-
<tr>
1872-
<td>{{QuotaExceededError}}</td>
1873-
<td>
1874-
The operation failed because there was not enough remaining
1875-
storage space, or the storage quota was reached and the user
1876-
declined to give more space to the database.
1877-
</td>
1878-
</tr>
18791870
<tr>
18801871
<td>{{SyntaxError}}</td>
18811872
<td>The keyPath argument contains an invalid key path.</td>
@@ -1907,6 +1898,11 @@ usage.
19071898
</tr>
19081899
</table>
19091900

1901+
Apart from the above {{DOMException}} names, the {{QuotaExceededError}}
1902+
exception type is to be used if the operation failed because there was
1903+
not enough remaining storage space, or the storage quota was reached and
1904+
the user declined to give more space to the database.
1905+
19101906
NOTE:
19111907
Given that multiple Indexed DB operations can throw the same type of
19121908
error, and that even a single operation can throw the same type of
@@ -2581,7 +2577,7 @@ reasons. Such implementations must still create and return an
25812577
creating the [=/object store=] has failed, it must abort the
25822578
transaction using the steps to [=abort a transaction=] using the
25832579
appropriate error. For example if creating the [=/object store=]
2584-
failed due to quota reasons, a "{{QuotaExceededError}}" {{DOMException}} must be used as
2580+
failed due to quota reasons, a {{QuotaExceededError}} must be used as
25852581
error.
25862582

25872583

@@ -3486,7 +3482,7 @@ and once the implementation determines that creating the index has
34863482
failed, it must run the steps to [=abort
34873483
a transaction=] using an appropriate error. For example
34883484
if creating the [=/index=] failed due to quota reasons,
3489-
a "{{QuotaExceededError}}" {{DOMException}} must be used as error and if the index can't be
3485+
a {{QuotaExceededError}} must be used as error and if the index can't be
34903486
created due to [=index/unique flag=] constraints, a "{{ConstraintError}}" {{DOMException}}
34913487
must be used as error.
34923488

@@ -4780,7 +4776,7 @@ NOTE:
47804776
due to an uncaught exception in an event handler, the error will be
47814777
a "{{AbortError}}" {{DOMException}}. If the [=/transaction=] was aborted due to
47824778
an error while committing, it will reflect the reason for the
4783-
failure (e.g. "{{QuotaExceededError}}", "{{ConstraintError}}", or
4779+
failure (e.g. a {{QuotaExceededError}}, or a "{{ConstraintError}}" or
47844780
"{{UnknownError}}" {{DOMException}}).
47854781

47864782
<div class="domintro note">
@@ -4920,7 +4916,7 @@ To <dfn>open a database connection</dfn> with |storageKey| which requested the [
49204916
1. If |db| is null, let |db| be a new [=/database=] with
49214917
[=database/name=] |name|, [=database/version=] 0 (zero), and with
49224918
no [=/object stores=]. If this fails for any reason, return an
4923-
appropriate error (e.g. a "{{QuotaExceededError}}" or
4919+
appropriate error (e.g. a {{QuotaExceededError}}, or an
49244920
"{{UnknownError}}" {{DOMException}}).
49254921

49264922
1. If |db|'s [=database/version=] is greater than |version|,
@@ -5065,7 +5061,7 @@ requested the [=/database=] to be deleted, a database |name|, and a
50655061
1. Let |version| be |db|'s [=database/version=].
50665062

50675063
1. Delete |db|. If this fails for any reason, return an appropriate
5068-
error (e.g. "{{QuotaExceededError}}" or "{{UnknownError}}" {{DOMException}}).
5064+
error (e.g. a {{QuotaExceededError}}, or an "{{UnknownError}}" {{DOMException}}).
50695065

50705066
1. Return |version|.
50715067

@@ -5094,7 +5090,7 @@ To <dfn>commit a transaction</dfn> with the |transaction| to commit, run these s
50945090

50955091
1. If an error occurs while writing the changes to the [=/database=],
50965092
then run [=abort a transaction=] with |transaction| and an
5097-
appropriate type for the error, for example "{{QuotaExceededError}}" or
5093+
appropriate type for the error, for example a {{QuotaExceededError}} or an
50985094
"{{UnknownError}}" {{DOMException}}, and terminate these steps.
50995095

51005096
1. [=Queue a database task=] to run these steps:

0 commit comments

Comments
 (0)