Skip to content

Commit

Permalink
#284: incorporate close loading screens with error dialogs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Mulholland committed Apr 25, 2018
1 parent 0fa7093 commit d952454
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,15 @@ async function loadPackage(urlText) {
const mainWindow = focusMainWindow()
mainWindow.webContents.send('closeAndshowLoadingScreen', 'Loading package URL..')
const dataPackageJson = await loadPackageJson(urlText, mainWindow)
if (!dataPackageJson) {
mainWindow.webContents.send('closeLoadingScreen')
return
}
console.log(dataPackageJson.descriptor)
console.log(dataPackageJson.errors)
if (!dataPackageJson.valid) {
showInvalidMessage(urlText, mainWindow)
mainWindow.webContents.send('closeLoadingScreen')
return
}
tmp.file({ mode: '0644', prefix: 'datapackage-', postfix: '.json' }, function _tempFileCreated(err, path, fd) {
Expand Down Expand Up @@ -83,7 +88,8 @@ async function loadPackageJson(json, mainWindow) {
`The data package, ${json}, could not be loaded.
If the data package is a URL, please check that the URL exists.`
})
throw new Error(`Unable to find URL: ${json}`)
// throw new Error()
// return Promise.reject(error)
}
}

Expand Down

0 comments on commit d952454

Please sign in to comment.