(e)
| 5 | // requires binding of SQLite |
| 6 | class SQLiteService { |
| 7 | handleSQLiteError(e) { |
| 8 | if (typeof e.message === 'string') { |
| 9 | const modalStore = useModalStore(); |
| 10 | if (e.message.includes('database disk image is malformed')) { |
| 11 | modalStore |
| 12 | .confirm({ |
| 13 | description: |
| 14 | 'Please repair or delete your database file by following these instructions.', |
| 15 | title: 'Your database is corrupted' |
| 16 | }) |
| 17 | .then(({ ok }) => { |
| 18 | if (!ok) return; |
| 19 | openExternalLink( |
| 20 | 'https://github.com/vrcx-team/VRCX/wiki#how-to-repair-vrcx-database' |
| 21 | ); |
| 22 | }) |
| 23 | .catch(() => {}); |
| 24 | } |
| 25 | if (e.message.includes('database or disk is full')) { |
| 26 | modalStore.alert({ |
| 27 | description: i18n.global.t('message.database.disk_space'), |
| 28 | title: 'Disk containing database is full' |
| 29 | }); |
| 30 | } |
| 31 | if ( |
| 32 | e.message.includes('database is locked') || |
| 33 | e.message.includes('attempt to write a readonly database') |
| 34 | ) { |
| 35 | modalStore.alert({ |
| 36 | description: |
| 37 | 'Please close other applications that might be using the database file.', |
| 38 | title: 'Database is locked' |
| 39 | }); |
| 40 | } |
| 41 | if (e.message.includes('disk I/O error')) { |
| 42 | modalStore.alert({ |
| 43 | description: i18n.global.t('message.database.disk_error'), |
| 44 | title: 'Disk I/O error' |
| 45 | }); |
| 46 | } |
| 47 | } |
| 48 | throw e; |
| 49 | } |
| 50 | |
| 51 | async execute(callback, sql, args = null) { |
| 52 | try { |
no test coverage detected