Skip to content

Commit f2cd646

Browse files
authored
Update QuotaExceededError usage (#463)
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 7c40323 commit f2cd646

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

index.bs

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,12 +1861,11 @@ NOTE:
18611861
# Exceptions # {#exceptions}
18621862
<!-- ============================================================ -->
18631863

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

1868-
The table below lists the {{DOMException}}s used in this
1869-
document along with a description of the exception type's
1867+
The table below lists the {{DOMException}} names used in this
1868+
document along with a description of the exception's
18701869
usage.
18711870

18721871
<table class=props>
@@ -1922,14 +1921,6 @@ usage.
19221921
the requested data could not be read.
19231922
</td>
19241923
</tr>
1925-
<tr>
1926-
<td>{{QuotaExceededError}}</td>
1927-
<td>
1928-
The operation failed because there was not enough remaining
1929-
storage space, or the storage quota was reached and the user
1930-
declined to give more space to the database.
1931-
</td>
1932-
</tr>
19331924
<tr>
19341925
<td>{{SyntaxError}}</td>
19351926
<td>The keyPath argument contains an invalid key path.</td>
@@ -1961,6 +1952,11 @@ usage.
19611952
</tr>
19621953
</table>
19631954

1955+
Apart from the above {{DOMException}} names, the {{QuotaExceededError}}
1956+
exception type is to be used if the operation failed because there was
1957+
not enough remaining storage space, or the storage quota was reached and
1958+
the user declined to give more space to the database.
1959+
19641960
NOTE:
19651961
Given that multiple Indexed DB operations can throw the same type of
19661962
error, and that even a single operation can throw the same type of
@@ -2635,7 +2631,7 @@ reasons. Such implementations must still create and return an
26352631
creating the [=/object store=] has failed, it must abort the
26362632
transaction using the steps to [=abort a transaction=] using the
26372633
appropriate error. For example if creating the [=/object store=]
2638-
failed due to quota reasons, a "{{QuotaExceededError}}" {{DOMException}} must be used as
2634+
failed due to quota reasons, a {{QuotaExceededError}} must be used as
26392635
error.
26402636

26412637

@@ -3540,7 +3536,7 @@ and once the implementation determines that creating the index has
35403536
failed, it must run the steps to [=abort
35413537
a transaction=] using an appropriate error. For example
35423538
if creating the [=/index=] failed due to quota reasons,
3543-
a "{{QuotaExceededError}}" {{DOMException}} must be used as error and if the index can't be
3539+
a {{QuotaExceededError}} must be used as error and if the index can't be
35443540
created due to [=index/unique flag=] constraints, a "{{ConstraintError}}" {{DOMException}}
35453541
must be used as error.
35463542

@@ -4870,7 +4866,7 @@ NOTE:
48704866
due to an uncaught exception in an event handler, the error will be
48714867
a "{{AbortError}}" {{DOMException}}. If the [=/transaction=] was aborted due to
48724868
an error while committing, it will reflect the reason for the
4873-
failure (e.g. "{{QuotaExceededError}}", "{{ConstraintError}}", or
4869+
failure (e.g. a {{QuotaExceededError}}, or a "{{ConstraintError}}" or
48744870
"{{UnknownError}}" {{DOMException}}).
48754871

48764872
<div class="domintro note">
@@ -5010,7 +5006,7 @@ To <dfn>open a database connection</dfn> with |storageKey| which requested the [
50105006
1. If |db| is null, let |db| be a new [=/database=] with
50115007
[=database/name=] |name|, [=database/version=] 0 (zero), and with
50125008
no [=/object stores=]. If this fails for any reason, return an
5013-
appropriate error (e.g. a "{{QuotaExceededError}}" or
5009+
appropriate error (e.g. a {{QuotaExceededError}}, or an
50145010
"{{UnknownError}}" {{DOMException}}).
50155011

50165012
1. If |db|'s [=database/version=] is greater than |version|,
@@ -5155,7 +5151,7 @@ requested the [=/database=] to be deleted, a database |name|, and a
51555151
1. Let |version| be |db|'s [=database/version=].
51565152

51575153
1. Delete |db|. If this fails for any reason, return an appropriate
5158-
error (e.g. "{{QuotaExceededError}}" or "{{UnknownError}}" {{DOMException}}).
5154+
error (e.g. a {{QuotaExceededError}}, or an "{{UnknownError}}" {{DOMException}}).
51595155

51605156
1. Return |version|.
51615157

@@ -5184,7 +5180,7 @@ To <dfn>commit a transaction</dfn> with the |transaction| to commit, run these s
51845180

51855181
1. If an error occurs while writing the changes to the [=/database=],
51865182
then run [=abort a transaction=] with |transaction| and an
5187-
appropriate type for the error, for example "{{QuotaExceededError}}" or
5183+
appropriate type for the error, for example a {{QuotaExceededError}} or an
51885184
"{{UnknownError}}" {{DOMException}}, and terminate these steps.
51895185

51905186
1. [=Queue a database task=] to run these steps:
@@ -6888,6 +6884,7 @@ For the revision history of the second edition, see [that document's Revision Hi
68886884
* Clarify cursor iteration predicates (<#450>)
68896885
* Add {{IDBObjectStore/getAllRecords(options)}} method to {{IDBObjectStore}} and {{IDBIndex}}. (<#206>)
68906886
* Add direction option to {{IDBObjectStore/getAll()}} and {{IDBObjectStore/getAllKeys()}} for {{IDBObjectStore}} and {{IDBIndex}} (<#130>)
6887+
* Use of {{QuotaExceededError}} has been updated to reflect that it is now a {{DOMException}}-derived interface instead of an exception name. (<#463>)
68916888

68926889
<!-- ============================================================ -->
68936890
# Acknowledgements # {#acknowledgements}

0 commit comments

Comments
 (0)