diff --git a/src/matrix/storage/idb/utils.js b/src/matrix/storage/idb/utils.js index 9fa8c55a..4ecb04d6 100644 --- a/src/matrix/storage/idb/utils.js +++ b/src/matrix/storage/idb/utils.js @@ -81,8 +81,9 @@ export function reqAsPromise(req) { resolve(event.target.result); needsSyncPromise && Promise._flush && Promise._flush(); }); - req.addEventListener("error", () => { - reject(new IDBRequestError(req)); + req.addEventListener("error", event => { + const error = new IDBRequestError(event.target); + reject(error); needsSyncPromise && Promise._flush && Promise._flush(); }); });