From 184480ad36977dbe19efbba9a4b6e89e2593b976 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 5 May 2021 14:36:43 +0200 Subject: [PATCH] no need to capture req here --- src/matrix/storage/idb/utils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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(); }); });