Added database connection error handling

This commit is contained in:
Geomitron
2020-05-27 15:07:31 -04:00
parent 157ed0c27a
commit 323a9116e3
6 changed files with 40 additions and 14 deletions

View File

@@ -28,13 +28,11 @@ class UpdateChecker {
private registerUpdaterListeners() {
autoUpdater.on('error', (err: Error) => {
console.log('error callback', err)
emitIPCEvent('update-error', err)
})
autoUpdater.on('update-available', (info: UpdateInfo) => {
updateAvailable = true
console.log('update available callback', info)
emitIPCEvent('update-available', info)
})
}
@@ -68,8 +66,7 @@ class GetCurrentVersionHandler implements IPCInvokeHandler<'get-current-version'
* @returns the current version of Bridge.
*/
handler() {
console.log('Printing version:', autoUpdater.currentVersion.raw)
return autoUpdater.currentVersion.raw // TODO: display this on the about page
return autoUpdater.currentVersion.raw
}
}

View File

@@ -1,12 +1,12 @@
import * as path from 'path'
import { join } from 'path'
import { app } from 'electron'
// Data paths
export const dataPath = path.join(app.getPath('userData'), 'bridge_data')
export const libraryPath = path.join(dataPath, 'library.db')
export const settingsPath = path.join(dataPath, 'settings.json')
export const tempPath = path.join(dataPath, 'temp')
export const themesPath = path.join(dataPath, 'themes')
export const dataPath = join(app.getPath('userData'), 'bridge_data')
export const libraryPath = join(dataPath, 'library.db')
export const settingsPath = join(dataPath, 'settings.json')
export const tempPath = join(dataPath, 'temp')
export const themesPath = join(dataPath, 'themes')
// URL
export const serverURL = '64.53.210.87'
export const serverURL = 'bridge-db.net'