2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 03:19:01 +00:00

fix: add console.error for db connection failure

This commit is contained in:
18alantom 2021-11-30 17:43:52 +05:30
parent 24b84b834b
commit 209e8bf7ec

View File

@ -1,7 +1,7 @@
import config from '@/config';
import { ipcRenderer } from 'electron';
import { _ } from 'frappejs';
import SQLite from 'frappejs/backends/sqlite';
import SQLiteDatabase from 'frappejs/backends/sqlite';
import fs from 'fs';
import postStart from '../server/postStart';
import { IPC_ACTIONS } from './messages';
@ -43,11 +43,12 @@ export async function connectToLocalDatabase(filePath) {
frappe.login('Administrator');
try {
frappe.db = new SQLite({
frappe.db = new SQLiteDatabase({
dbPath: filePath,
});
await frappe.db.connect();
} catch (error) {
console.error(error);
return false;
}