mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
LibWeb/IDB: Improve error messages related to transaction state
This commit is contained in:
committed by
Jelle Raaijmakers
parent
6237824d99
commit
0890b10d11
Notes:
github-actions[bot]
2025-05-06 09:18:32 +00:00
Author: https://github.com/stelar7 Commit: https://github.com/LadybirdBrowser/ladybird/commit/0890b10d11b Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4524 Reviewed-by: https://github.com/gmta ✅
@@ -109,7 +109,7 @@ WebIDL::ExceptionOr<GC::Ref<IDBObjectStore>> IDBDatabase::create_object_store(St
|
||||
|
||||
// 3. If transaction’s state is not active, then throw a "TransactionInactiveError" DOMException.
|
||||
if (transaction->state() != IDBTransaction::TransactionState::Active)
|
||||
return WebIDL::TransactionInactiveError::create(realm, "Transaction is not active"_string);
|
||||
return WebIDL::TransactionInactiveError::create(realm, "Transaction is not active while creating object store"_string);
|
||||
|
||||
// 4. Let keyPath be options’s keyPath member if it is not undefined or null, or null otherwise.
|
||||
auto key_path = options.key_path;
|
||||
@@ -171,7 +171,7 @@ WebIDL::ExceptionOr<void> IDBDatabase::delete_object_store(String const& name)
|
||||
|
||||
// 3. If transaction’s state is not active, then throw a "TransactionInactiveError" DOMException.
|
||||
if (transaction->state() != IDBTransaction::TransactionState::Active)
|
||||
return WebIDL::TransactionInactiveError::create(realm, "Transaction is not active"_string);
|
||||
return WebIDL::TransactionInactiveError::create(realm, "Transaction is not active while deleting object store"_string);
|
||||
|
||||
// 4. Let store be the object store named name in database, or throw a "NotFoundError" DOMException if none.
|
||||
auto store = database->object_store_with_name(name);
|
||||
|
||||
Reference in New Issue
Block a user