Skip to content

Instantly share code, notes, and snippets.

@moomoohk
Last active August 29, 2015 14:08
Show Gist options
  • Save moomoohk/b53f24de22eaf21b1133 to your computer and use it in GitHub Desktop.
Save moomoohk/b53f24de22eaf21b1133 to your computer and use it in GitHub Desktop.
void save() {
Store store1 = new Store(dbName, store1Name); // Opening first nonexistent store, all good
store1.open().then((_) {
store1.batch({
// This will run sucessfully and the data will be saved
});
});
Store store2 = new Store(dbName, store2Name);
store2.open().then((_) {
store2.batch({ // Stack trace indicates this line is the problematic one
// This store will never be created and this data will not be saved
});
});
}
Exception: Uncaught Error: NotFoundError: One of the specified object stores was not found.
Stack Trace:
#0 BlinkIDBDatabase.transaction_Callback_DOMString_DOMString (dart:_blink:3766)
#1 Database.transaction (dart:indexed_db:243)
#2 IndexedDbStore._doCommand (package:lawndart/src/indexeddb_store.dart:96:32)
#3 IndexedDbStore._save (package:lawndart/src/indexeddb_store.dart:77:22)
#4 Store.save (package:lawndart/lawndart.dart:110:17)
#5 IndexedDbStore._batch (package:lawndart/src/indexeddb_store.dart:125:23)
#6 Store.batch (package:lawndart/lawndart.dart:120:18)
#7 Profile.save.<anonymous closure> (http://localhost:8080/assets/dart/profile.dart:91:24) <- Line 11 in the previous file
#8 _RootZone.runUnary (dart:async/zone.dart:1151)
#9 _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:496)
#10 _Future._propagateToListeners (dart:async/future_impl.dart:579)
#11 _Future._complete (dart:async/future_impl.dart:325)
#12 _SyncCompleter.complete (dart:async/future_impl.dart:53)
#13 _completeRequest.<anonymous closure> (dart:indexed_db:412)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment