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",
"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": {

View File

@ -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;
}