mirror of
https://github.com/servo/servo.git
synced 2025-09-30 08:39:16 +01:00
[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:
parent
72e0baa997
commit
d114feb0fa
5 changed files with 60 additions and 28 deletions
|
@ -135,9 +135,13 @@ impl<E: KvsEngine> IndexedDBEnvironment<E> {
|
|||
store_name: SanitizedName,
|
||||
auto_increment: bool,
|
||||
) {
|
||||
self.engine.create_store(store_name, auto_increment);
|
||||
let result = self.engine.create_store(store_name, auto_increment);
|
||||
|
||||
let _ = sender.send(Ok(()));
|
||||
if result.is_ok() {
|
||||
let _ = sender.send(Ok(()));
|
||||
} else {
|
||||
let _ = sender.send(Err(()));
|
||||
}
|
||||
}
|
||||
|
||||
fn delete_object_store(
|
||||
|
@ -145,9 +149,13 @@ impl<E: KvsEngine> IndexedDBEnvironment<E> {
|
|||
sender: IpcSender<Result<(), ()>>,
|
||||
store_name: SanitizedName,
|
||||
) {
|
||||
self.engine.delete_store(store_name);
|
||||
let result = self.engine.delete_store(store_name);
|
||||
|
||||
let _ = sender.send(Ok(()));
|
||||
if result.is_ok() {
|
||||
let _ = sender.send(Ok(()));
|
||||
} else {
|
||||
let _ = sender.send(Err(()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue