diff --git a/src/plugin/sentry.js b/src/plugin/sentry.js index 444b5792..3be3fa94 100644 --- a/src/plugin/sentry.js +++ b/src/plugin/sentry.js @@ -58,6 +58,17 @@ export async function initSentry(app) { error.message.includes('404') || error.message.includes('500') || error.message.includes('503') || + error.message.includes('No such host is known') || + error.message.includes( + 'The SSL connection could not be established' + ) || + error.message.includes('A connection attempt failed') || + error.message.includes( + 'no data of the requested type was found' + ) || + error.message.includes( + 'An error occurred while sending the request' + ) || error.message.includes('database or disk is full') || error.message.includes( 'There is not enough space on the disk.' diff --git a/src/service/sqlite.js b/src/service/sqlite.js index 3241c8c5..02bf08da 100644 --- a/src/service/sqlite.js +++ b/src/service/sqlite.js @@ -33,6 +33,16 @@ class SQLiteService { } ).catch(() => {}); } + if (e.message.includes('database is locked')) { + ElMessageBox.alert( + 'Please close other applications that might be using the database file.', + 'Database is locked', + { + confirmButtonText: 'OK', + type: 'warning' + } + ).catch(() => {}); + } } throw e; } diff --git a/src/stores/gallery.js b/src/stores/gallery.js index f1c000f6..afce3dbd 100644 --- a/src/stores/gallery.js +++ b/src/stores/gallery.js @@ -1,20 +1,22 @@ import { reactive, ref, shallowReactive, watch } from 'vue'; +import { ElMessageBox } from 'element-plus'; import { defineStore } from 'pinia'; import { useI18n } from 'vue-i18n'; import Noty from 'noty'; +import { + getEmojiFileName, + getPrintFileName, + getPrintLocalDate, + openExternalLink +} from '../shared/utils'; import { inventoryRequest, userRequest, vrcPlusIconRequest, vrcPlusImageRequest } from '../api'; -import { - getEmojiFileName, - getPrintFileName, - getPrintLocalDate -} from '../shared/utils'; import { AppDebug } from '../service/appConfig'; import { handleImageUploadInput } from '../shared/utils/imageUpload'; import { useAdvancedSettingsStore } from './settings/advanced'; @@ -487,16 +489,38 @@ export const useGalleryStore = defineStore('Gallery', () => { const createdAt = args.json.created_at; const monthFolder = createdAt.slice(0, 7); - const filePath = await AppApi.SaveEmojiToFile( - imageUrl, - advancedSettingsStore.ugcFolderPath, - monthFolder, - emojiFileName - ); - if (filePath) { - console.log( - `Emoji saved to file: ${monthFolder}\\${emojiFileName}` + try { + const filePath = await AppApi.SaveEmojiToFile( + imageUrl, + advancedSettingsStore.ugcFolderPath, + monthFolder, + emojiFileName ); + if (filePath) { + console.log( + `Emoji saved to file: ${monthFolder}\\${emojiFileName}` + ); + } + } catch (e) { + if (e.message.includes('Could not find file')) { + ElMessageBox.confirm( + 'Windows has blocked VRCX from creating files on your system. Please allow VRCX to create files to save emojis, would you like to see instructions on how to fix this?', + 'Failed to create emoji folder', + { + confirmButtonText: 'Confirm', + cancelButtonText: 'Ignore', + type: 'warning' + } + ) + .then(async (action) => { + if (action !== 'confirm') return; + openExternalLink( + 'https://www.youtube.com/watch?v=1mwmmCdA4D8&t=213s' + ); + }) + .catch(() => {}); + } + console.error('Failed to save emoji to file:', e); } if (state.instanceInventoryQueue.length === 0) { diff --git a/src/stores/launch.js b/src/stores/launch.js index c6fa12ac..d7d29c02 100644 --- a/src/stores/launch.js +++ b/src/stores/launch.js @@ -150,11 +150,12 @@ export const useLaunchStore = defineStore('Launch', () => { if (desktopMode) { args.push('--no-vr'); } - if (vrcLaunchPathOverride && !LINUX) { - AppApi.StartGameFromPath( - vrcLaunchPathOverride, - args.join(' ') - ).then((result) => { + try { + if (vrcLaunchPathOverride && !LINUX) { + const result = await AppApi.StartGameFromPath( + vrcLaunchPathOverride, + args.join(' ') + ); if (!result) { ElMessage({ message: @@ -167,9 +168,8 @@ export const useLaunchStore = defineStore('Launch', () => { type: 'success' }); } - }); - } else { - AppApi.StartGame(args.join(' ')).then((result) => { + } else { + const result = await AppApi.StartGame(args.join(' ')); if (!result) { ElMessage({ message: @@ -182,6 +182,12 @@ export const useLaunchStore = defineStore('Launch', () => { type: 'success' }); } + } + } catch (e) { + console.error(e); + ElMessage({ + message: `Failed to launch VRChat: ${e.message}`, + type: 'error' }); } console.log('Launch Game', args.join(' '), desktopMode);