Give correct feedback if an app cannot be found in the appstore
This commit is contained in:
@@ -293,6 +293,7 @@ function purchase(appStoreId, callback) {
|
||||
superagent.post(url).query({ token: config.token() }).end(function (error, res) {
|
||||
if (error) return callback(new AppsError(AppsError.INTERNAL_ERROR, error));
|
||||
if (res.status === 402) return callback(new AppsError(AppsError.BILLING_REQUIRED));
|
||||
if (res.status === 404) return callback(new AppsError(AppsError.NOT_FOUND));
|
||||
if (res.status !== 201 && res.status !== 200) return callback(new Error(util.format('App purchase failed. %s %j', res.status, res.body)));
|
||||
|
||||
callback(null);
|
||||
|
||||
Reference in New Issue
Block a user