Skip to content

Commit

Permalink
fix(package): installation falls back to XMLRPC
Browse files Browse the repository at this point in the history
fixes #170

Try REST connection, fall back to XMLRPC and inform user that this
happened.
  • Loading branch information
line-o committed Oct 27, 2023
1 parent fb0daf2 commit d2768b3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions commands/package/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,13 @@ export async function handler (argv) {
if (rest) {
upload = boundUpload
} else {
const test = await restClient.get('db')
upload = test.statusCode === 200 ? boundUpload : db.app.upload
try {
await restClient.get('db')
upload = boundUpload
} catch (e) {
console.log('Falling back to XMLRPC API')
upload = db.app.upload
}
}
}

Expand Down

0 comments on commit d2768b3

Please sign in to comment.