diff --git a/src-electron/db/query-package-notification.js b/src-electron/db/query-package-notification.js index 811b122c17..b1e4638725 100644 --- a/src-electron/db/query-package-notification.js +++ b/src-electron/db/query-package-notification.js @@ -29,16 +29,10 @@ const dbMapping = require('./db-mapping.js') * @param {*} db * @param {*} type * @param {*} status - * @param {*} sessionId + * @param {*} packageId * @param {*} severity */ -async function setNotification( - db, - type, - status, - packageId, - severity = 2, -) { +async function setNotification(db, type, status, packageId, severity = 2) { return dbApi.dbUpdate( db, 'INSERT INTO PACKAGE_NOTICE ( PACKAGE_REF, NOTICE_TYPE, NOTICE_MESSAGE, NOTICE_SEVERITY) VALUES ( ?, ?, ?, ? )', @@ -72,8 +66,8 @@ async function getNotificationBySessionId(db, sessionId) { let rows = [] rows = await dbApi.dbAll( db, - 'SELECT * FROM PACKAGE_NOTICE WHERE PACKAGE_REF IN' - + '( SELECT PACKAGE_REF FROM SESSION_PACKAGE WHERE SESSION_REF = ( ? ) )', + 'SELECT * FROM PACKAGE_NOTICE WHERE PACKAGE_REF IN' + + '( SELECT PACKAGE_REF FROM SESSION_PACKAGE WHERE SESSION_REF = ( ? ) )', [sessionId] ) return rows.map(dbMapping.map.packageNotification) @@ -86,10 +80,7 @@ async function getNotificationBySessionId(db, sessionId) { */ async function getAllNotification(db) { let rows = [] - rows = await dbApi.dbAll( - db, - 'SELECT * FROM PACKAGE_NOTICE' - ) + rows = await dbApi.dbAll(db, 'SELECT * FROM PACKAGE_NOTICE') return rows.map(dbMapping.map.packageNotification) } /** @@ -109,7 +100,6 @@ async function getNotificationByPackageId(db, packageId) { return rows.map(dbMapping.map.packageNotification) } - // exports exports.setNotification = setNotification exports.deleteNotification = deleteNotification diff --git a/src-electron/importexport/import-json.js b/src-electron/importexport/import-json.js index f4e5f4904e..fd95cb264d 100644 --- a/src-electron/importexport/import-json.js +++ b/src-electron/importexport/import-json.js @@ -136,7 +136,8 @@ async function importSinglePackage(db, pkg, zapFilePath, packageMatch) { env.logDebug(`No packages of type ${pkg.type} found in the database.`) return null } else { - throw new Error(`No packages of type ${pkg.type} found in the database.`) + env.logError(`No packages of type ${pkg.type} found in the database.`) + return null } } else if (packages.length == 1) { env.logDebug( diff --git a/src-electron/zcl/zcl-loader-silabs.js b/src-electron/zcl/zcl-loader-silabs.js index ec7bfdd053..503b8f167c 100644 --- a/src-electron/zcl/zcl-loader-silabs.js +++ b/src-electron/zcl/zcl-loader-silabs.js @@ -2220,7 +2220,7 @@ async function loadIndividualSilabsFile(db, filePath, sessionId) { querySessionNotification.setNotification( db, 'ERROR', - `Error reading xml file: ${filePath}\n` + err.message, + `Error reading xml file: ${filePath}, Error Message: ` + err.message, sessionId, 1, 0