Skip to content

Commit

Permalink
Allow the ZAP UI to load when a custom xml file is not found instead …
Browse files Browse the repository at this point in the history
…of throwing an error (project-chip#1225)

- The changes to import-json.js allows the ZAP UI to load instead of throwing an error and locking ZAP.
- Now the error message appears in the ZAP notification's pane so that the user can see a detailed error and act upon it
- Minor cleanup
- JIRA: ZAPP-1148
  • Loading branch information
brdandu authored Dec 4, 2023
1 parent cd27c8e commit ae7f7cf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
20 changes: 5 additions & 15 deletions src-electron/db/query-package-notification.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src-electron/importexport/import-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src-electron/zcl/zcl-loader-silabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ae7f7cf

Please sign in to comment.