diff --git a/src-electron/db/query-impexp.js b/src-electron/db/query-impexp.js index 925f625f76..a4e37d3df8 100644 --- a/src-electron/db/query-impexp.js +++ b/src-electron/db/query-impexp.js @@ -24,6 +24,8 @@ const dbApi = require('./db-api') const dbEnums = require('../../src-shared/db-enum') const dbMapping = require('./db-mapping.js') const queryUpgrade = require('../sdk/matter.js') +const sessionNotification = require('./query-session-notification') + /** * Imports a single endpoint * @param {} db @@ -234,13 +236,15 @@ ORDER BY * @param {*} sessionPartitionId * @param {*} packageId * @param {*} endpointType + * @param {*} sessionId * @returns Promise of endpoint insertion. */ async function importEndpointType( db, sessionPartitionId, packageIds, - endpointType + endpointType, + sessionId ) { // Insert endpoint type let endpointTypeId = await dbApi.dbInsert( @@ -306,6 +310,18 @@ async function importEndpointType( ] ) + // Log an error message into the session notice table when device types being imported are not found + if (!rows || rows.length == 0) { + sessionNotification.setNotification( + db, + 'ERROR', + 'Device Types could not be found in the ZCL extensions linked to this project. Please make sure the zcl and template json files listed in your zap file exist.', + sessionId, + 1, + 1 + ) + } + // Associate deviceTypes with the endpointType for (let row of rows) { promises.push( diff --git a/src-electron/importexport/import-json.js b/src-electron/importexport/import-json.js index d19885db81..a41d264faf 100644 --- a/src-electron/importexport/import-json.js +++ b/src-electron/importexport/import-json.js @@ -1343,7 +1343,8 @@ async function importEndpointTypes( db, sessionPartitionInfo[0].sessionPartitionId, allZclPackageIds, - endpointTypes[i] + endpointTypes[i], + sessionId ) let endpointId = '' if (sortedEndpoints[i]) {