try more domexception fixes

This commit is contained in:
Bruno Windels 2019-11-21 18:28:18 +01:00
parent 5ecf0a6717
commit 325077bcb0
2 changed files with 6 additions and 3 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "brawl-chat", "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", "description": "A javascript matrix client prototype, trying to minize RAM usage by offloading as much as possible to IndexedDB",
"main": "index.js", "main": "index.js",
"directories": { "directories": {

View file

@ -17,8 +17,11 @@ export class StorageError extends Error {
let fullMessage = message; let fullMessage = message;
if (cause) { if (cause) {
fullMessage += ": "; fullMessage += ": ";
if (cause.name) { if (typeof cause.name === "string") {
fullMessage += `(${cause.name}) `; fullMessage += `(name: ${cause.name}) `;
}
if (typeof cause.code === "number") {
fullMessage += `(code: ${cause.name}) `;
} }
fullMessage += cause.message; fullMessage += cause.message;
} }