[IndexedDB] Reduce heed related panics (#37652)

Allows indexeddb backends to return errors on certain operations.
Currently the errors are not demarcated, as the result type is
`Result<(), ()>`. If this is not appropriate then perhaps having a
string error might be better.

Testing: Some tests might perhaps move from PANIC to FAIL
Fixes: Partially fixes a bit of #37647, more work needs to be done
however

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Ashwin Naren 2025-06-24 17:22:19 -07:00 committed by GitHub
parent 72e0baa997
commit d114feb0fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 60 additions and 28 deletions

View file

@ -57,12 +57,18 @@ pub struct KvsTransaction {
}
pub trait KvsEngine {
fn create_store(&self, store_name: SanitizedName, auto_increment: bool);
type Error;
fn delete_store(&self, store_name: SanitizedName);
fn create_store(
&self,
store_name: SanitizedName,
auto_increment: bool,
) -> Result<(), Self::Error>;
fn delete_store(&self, store_name: SanitizedName) -> Result<(), Self::Error>;
#[expect(dead_code)]
fn close_store(&self, store_name: SanitizedName);
fn close_store(&self, store_name: SanitizedName) -> Result<(), Self::Error>;
fn process_transaction(
&self,