Skip to content

Commit

Permalink
feat: improve installation error messages
Browse files Browse the repository at this point in the history
Provide the user with a more meaningful error message,
when a package cannot be uploaded or the installation
failed.
  • Loading branch information
line-o committed Feb 3, 2023
1 parent b4ff274 commit 13ba419
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,16 @@ function install (client, options) {

client.app.upload(file.contents, xarName)
.then(response => {
if (!response.success) { return callback(new PluginError('gulp-exist', 'XAR was not uploaded')) }
if (!response.success) {
return callback(new PluginError('gulp-exist', `XAR was not uploaded: ${response.error}`))
}
log(`Install ${xarName}`)
return client.app.install(xarName, customPackageRepoUrl)
})
.then(response => {
if (!response.success) { return callback(new PluginError('gulp-exist', 'XAR Installation failed')) }
if (!response.success) {
return callback(new PluginError('gulp-exist', `XAR Installation failed: ${response.error}`))
}
if (response.result.update) {
log('Application was updated')
return callback(null, response)
Expand Down

0 comments on commit 13ba419

Please sign in to comment.