LibWeb/IDB: Use invalidation reason when returning DataError

This commit is contained in:
stelar7 2025-04-29 17:39:22 +02:00 committed by Jelle Raaijmakers
parent 05fe37619a
commit d0156e2c88
Notes: github-actions[bot] 2025-05-06 09:18:01 +00:00

View file

@ -289,7 +289,7 @@ WebIDL::ExceptionOr<GC::Ref<IDBRequest>> IDBObjectStore::add_or_put(GC::Ref<IDBO
// 2. If kpk is invalid, throw a "DataError" DOMException.
if (key_value->is_invalid())
return WebIDL::DataError::create(realm, "Key path is invalid"_string);
return WebIDL::DataError::create(realm, key_value->value_as_string());
}
// 4. Otherwise (kpk is failure):