From 325077bcb0b7537eff120d32adafd589fd5cfe9b Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 21 Nov 2019 18:28:18 +0100 Subject: [PATCH] try more domexception fixes --- package.json | 2 +- src/matrix/storage/common.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index fdeb2c7f..ac134916 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "brawl-chat", - "version": "0.0.7", + "version": "0.0.9", "description": "A javascript matrix client prototype, trying to minize RAM usage by offloading as much as possible to IndexedDB", "main": "index.js", "directories": { diff --git a/src/matrix/storage/common.js b/src/matrix/storage/common.js index aee08158..4ae55e65 100644 --- a/src/matrix/storage/common.js +++ b/src/matrix/storage/common.js @@ -17,8 +17,11 @@ export class StorageError extends Error { let fullMessage = message; if (cause) { fullMessage += ": "; - if (cause.name) { - fullMessage += `(${cause.name}) `; + if (typeof cause.name === "string") { + fullMessage += `(name: ${cause.name}) `; + } + if (typeof cause.code === "number") { + fullMessage += `(code: ${cause.name}) `; } fullMessage += cause.message; }