diff --git a/src/lib/tw-local-backpack-api.js b/src/lib/tw-local-backpack-api.js index 3e3224870c2..a7960490ca6 100644 --- a/src/lib/tw-local-backpack-api.js +++ b/src/lib/tw-local-backpack-api.js @@ -94,7 +94,7 @@ const getBackpackContents = async ({ return new Promise((resolve, reject) => { const transaction = db.transaction(STORE_NAME, 'readonly'); transaction.onerror = event => { - reject(new Error(`Transaction error: ${event.target.error}`)); + reject(new Error(`Getting contents: ${event.target.error}`)); }; const store = transaction.objectStore(STORE_NAME); const items = []; @@ -133,7 +133,7 @@ const saveBackpackObject = async ({ return new Promise((resolve, reject) => { const transaction = db.transaction(STORE_NAME, 'readwrite'); transaction.onerror = event => { - reject(new Error(`Transaction error: ${event.target.error}`)); + reject(new Error(`Sving object: ${event.target.error}`)); }; const store = transaction.objectStore(STORE_NAME); const bodyData = base64ToArrayBuffer(body); @@ -162,7 +162,7 @@ const deleteBackpackObject = async ({ return new Promise((resolve, reject) => { const transaction = db.transaction(STORE_NAME, 'readwrite'); transaction.onerror = event => { - reject(new Error(`Transaction error: ${event.target.error}`)); + reject(new Error(`Deleting object: ${event.target.error}`)); }; const store = transaction.objectStore(STORE_NAME); // Convert string IDs to number IDs @@ -182,7 +182,7 @@ const updateBackpackObject = async ({ return new Promise((resolve, reject) => { const transaction = db.transaction(STORE_NAME, 'readwrite'); transaction.onerror = event => { - reject(new Error(`Transaction error: ${event.target.error}`)); + reject(new Error(`Updating object: ${event.target.error}`)); }; const store = transaction.objectStore(STORE_NAME); const getRequest = store.get(id); diff --git a/src/lib/tw-restore-point-api.js b/src/lib/tw-restore-point-api.js index 6b0e1d4040d..4f512fb3c91 100644 --- a/src/lib/tw-restore-point-api.js +++ b/src/lib/tw-restore-point-api.js @@ -161,7 +161,7 @@ const removeExtraneousData = transaction => new Promise(resolve => { const removeExtraneousRestorePoints = () => openDB().then(db => new Promise((resolveTransaction, rejectTransaction) => { const transaction = db.transaction(ALL_STORES, 'readwrite'); transaction.onerror = event => { - rejectTransaction(new Error(`Transaction error: ${event.target.error}`)); + rejectTransaction(new Error(`Removing extraneous: ${event.target.error}`)); }; // Figuring out which restore points to keep and which to remove is non-trivial. @@ -311,7 +311,7 @@ const createRestorePoint = ( generateThumbnail(vm).then(thumbnailData => { const transaction = db.transaction(ALL_STORES, 'readwrite'); transaction.onerror = event => { - rejectTransaction(new Error(`Transaction error: ${event.target.error}`)); + rejectTransaction(new Error(`Creating restore point: ${event.target.error}`)); }; // Will be generated by database @@ -398,7 +398,7 @@ const createRestorePoint = ( const deleteRestorePoint = id => openDB().then(db => new Promise((resolve, reject) => { const transaction = db.transaction(ALL_STORES, 'readwrite'); transaction.onerror = event => { - reject(new Error(`Transaction error: ${event.target.error}`)); + reject(new Error(`Deleting restore point: ${event.target.error}`)); }; const metadataStore = transaction.objectStore(METADATA_STORE); @@ -415,7 +415,7 @@ const deleteRestorePoint = id => openDB().then(db => new Promise((resolve, rejec const deleteAllRestorePoints = () => openDB().then(db => new Promise((resolveTransaction, rejectTransaction) => { const transaction = db.transaction(ALL_STORES, 'readwrite'); transaction.onerror = event => { - rejectTransaction(new Error(`Transaction error: ${event.target.error}`)); + rejectTransaction(new Error(`Deleting all restore points: ${event.target.error}`)); }; const deleteEverything = async () => { @@ -449,7 +449,7 @@ const loadRestorePoint = (vm, id) => openDB().then(db => new Promise((resolvePro load: (assetType, assetId, dataFormat) => new Promise((resolveFetch, rejectFetch) => { const transaction = db.transaction([ASSET_STORE], 'readonly'); transaction.onerror = event => { - rejectFetch(new Error(`Transaction error: ${event.target.error}`)); + rejectFetch(new Error(`Loading restore point asset: ${event.target.error}`)); }; const md5ext = `${assetId}.${dataFormat}`; @@ -475,7 +475,7 @@ const loadRestorePoint = (vm, id) => openDB().then(db => new Promise((resolvePro const loadProjectJSON = () => { const transaction = db.transaction([PROJECT_STORE], 'readonly'); transaction.onerror = event => { - rejectProject(new Error(`Transaction error: ${event.target.error}`)); + rejectProject(new Error(`Loading restore point JSON: ${event.target.error}`)); }; const projectStore = transaction.objectStore(PROJECT_STORE); @@ -509,7 +509,7 @@ const loadRestorePoint = (vm, id) => openDB().then(db => new Promise((resolvePro const getAllRestorePoints = () => openDB().then(db => new Promise((resolve, reject) => { const transaction = db.transaction([METADATA_STORE], 'readonly'); transaction.onerror = event => { - reject(new Error(`Transaction error: ${event.target.error}`)); + reject(new Error(`Getting all restore points: ${event.target.error}`)); }; /** @type {Metadata[]} */ @@ -553,7 +553,7 @@ const getAllRestorePoints = () => openDB().then(db => new Promise((resolve, reje const getThumbnail = id => openDB().then(db => new Promise((resolve, reject) => { const transaction = db.transaction([THUMBNAIL_STORE], 'readonly'); transaction.onerror = event => { - reject(new Error(`Transaction error: ${event.target.error}`)); + reject(new Error(`Getting thumbnail: ${event.target.error}`)); }; const thumbnailStore = transaction.objectStore(THUMBNAIL_STORE);