Include more error information when IndexedDB operations fail.

This commit is contained in:
Ben Newman
2017-03-07 16:43:54 -05:00
parent 732915c9a2
commit 23e82bb1ef

View File

@@ -29,10 +29,10 @@ function withDB(callback) {
function makeOnError(reject, source) {
return function (event) {
var error = new Error("IndexedDB failure in " + source);
var idbError = event.target.error;
error.stack = idbError && idbError.stack;
reject(error);
reject(new Error(
"IndexedDB failure in " + source + " " +
JSON.stringify(event.target)
));
};
}