script: correctly handle indexeddb backend errors (#38740)

Sets the indexeddb request error when the backend errors out. This also
matches statements to the spec.

Testing: Covered by WPT
Fixes: General indexeddb

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Ashwin Naren 2025-08-28 00:49:17 -07:00 committed by GitHub
parent 57f25d0a8a
commit 91b27d98a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 49 additions and 24 deletions

View file

@ -41,7 +41,7 @@ thread_local! {
}
/// Error values that have no equivalent DOMException representation.
enum JsEngineError {
pub(crate) enum JsEngineError {
/// An EMCAScript TypeError.
Type(String),
/// An ECMAScript RangeError.
@ -94,7 +94,7 @@ pub(crate) fn throw_dom_exception(
/// If possible, create a new DOMException representing the provided error.
/// If no such DOMException exists, return a subset of the original error values
/// that may need additional handling.
fn create_dom_exception(
pub(crate) fn create_dom_exception(
global: &GlobalScope,
result: Error,
can_gc: CanGc,