Fix http status code handling

This commit is contained in:
Girish Ramakrishnan
2019-05-05 10:31:42 -07:00
parent 92941260a5
commit c74cf59e3b
4 changed files with 56 additions and 43 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ function getSubscription(req, res, next) {
assert.strictEqual(typeof req.body, 'object');
appstore.getSubscription(function (error, result) {
if (error && error.reason === AppstoreError.BILLING_REQUIRED) return next(new HttpError(402, error.message));
if (error && error.reason === AppstoreError.INVALID_TOKEN) return next(new HttpError(402, error.message));
if (error && error.reason === AppstoreError.EXTERNAL_ERROR) return next(new HttpError(424, error.message));
if (error) return next(new HttpError(500, error));