From 78a5abfab1d6fb4b59abe49997e8f35a9ed6554b Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Tue, 8 Jul 2025 13:34:14 +0900 Subject: [PATCH] Update QuotaExceededError usage QuotaExceededError is graduating from being a DOMException name into a new error class, in https://github.com/whatwg/webidl/pull/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. --- index.bs | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/index.bs b/index.bs index c018340..0820ed6 100644 --- a/index.bs +++ b/index.bs @@ -1807,12 +1807,11 @@ store.put(4); // will throw DataError # Exceptions # {#exceptions} -Each of the exceptions used in this document is a -{{DOMException}} with a specific type. The exception types and -properties such as legacy code value are defined in [[!WEBIDL]]. +Each of the exceptions used in this document is a {{DOMException}} +or {{DOMException}}-derived interface, as defined in [[!WEBIDL]]. -The table below lists the {{DOMException}}s used in this -document along with a description of the exception type's +The table below lists the {{DOMException}} names used in this +document along with a description of the exception's usage. @@ -1868,14 +1867,6 @@ usage. the requested data could not be read. - - - - @@ -1907,6 +1898,11 @@ usage.
{{QuotaExceededError}} - The operation failed because there was not enough remaining - storage space, or the storage quota was reached and the user - declined to give more space to the database. -
{{SyntaxError}} The keyPath argument contains an invalid key path.
+Apart from the above {{DOMException}} names, the {{QuotaExceededError}} +exception type is to be used if the operation failed because there was +not enough remaining storage space, or the storage quota was reached and +the user declined to give more space to the database. + NOTE: Given that multiple Indexed DB operations can throw the same type of 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 creating the [=/object store=] has failed, it must abort the transaction using the steps to [=abort a transaction=] using the appropriate error. For example if creating the [=/object store=] -failed due to quota reasons, a "{{QuotaExceededError}}" {{DOMException}} must be used as +failed due to quota reasons, a {{QuotaExceededError}} must be used as error. @@ -3486,7 +3482,7 @@ and once the implementation determines that creating the index has failed, it must run the steps to [=abort a transaction=] using an appropriate error. For example if creating the [=/index=] failed due to quota reasons, -a "{{QuotaExceededError}}" {{DOMException}} must be used as error and if the index can't be +a {{QuotaExceededError}} must be used as error and if the index can't be created due to [=index/unique flag=] constraints, a "{{ConstraintError}}" {{DOMException}} must be used as error. @@ -4780,7 +4776,7 @@ NOTE: due to an uncaught exception in an event handler, the error will be a "{{AbortError}}" {{DOMException}}. If the [=/transaction=] was aborted due to an error while committing, it will reflect the reason for the - failure (e.g. "{{QuotaExceededError}}", "{{ConstraintError}}", or + failure (e.g. a {{QuotaExceededError}}, or a "{{ConstraintError}}" or "{{UnknownError}}" {{DOMException}}).
@@ -4920,7 +4916,7 @@ To open a database connection with |storageKey| which requested the [ 1. If |db| is null, let |db| be a new [=/database=] with [=database/name=] |name|, [=database/version=] 0 (zero), and with no [=/object stores=]. If this fails for any reason, return an - appropriate error (e.g. a "{{QuotaExceededError}}" or + appropriate error (e.g. a {{QuotaExceededError}}, or an "{{UnknownError}}" {{DOMException}}). 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 1. Let |version| be |db|'s [=database/version=]. 1. Delete |db|. If this fails for any reason, return an appropriate - error (e.g. "{{QuotaExceededError}}" or "{{UnknownError}}" {{DOMException}}). + error (e.g. a {{QuotaExceededError}}, or an "{{UnknownError}}" {{DOMException}}). 1. Return |version|. @@ -5094,7 +5090,7 @@ To commit a transaction with the |transaction| to commit, run these s 1. If an error occurs while writing the changes to the [=/database=], then run [=abort a transaction=] with |transaction| and an - appropriate type for the error, for example "{{QuotaExceededError}}" or + appropriate type for the error, for example a {{QuotaExceededError}} or an "{{UnknownError}}" {{DOMException}}, and terminate these steps. 1. [=Queue a database task=] to run these steps: @@ -6719,6 +6715,7 @@ For the revision history of the second edition, see [that document's Revision Hi * Define [=Queue a database task=] and replace [=Queue a task=] with it (<#421>) * Add missing parallel step to {{IDBFactory/databases()|databases}}() (<#421>) * Clarify cursor iteration predicates (<#450>) +* Use of {{QuotaExceededError}} has been updated to reflect that it is now a {{DOMException}}-derived interface instead of an exception name. (<#463>) # Acknowledgements # {#acknowledgements}