Handle already exists

This commit is contained in:
Girish Ramakrishnan
2019-05-04 11:13:49 -07:00
parent 0f521e2521
commit 4fc6f5a094
+1
View File
@@ -31,6 +31,7 @@ function getSubscription(req, res, next) {
assert.strictEqual(typeof req.body, 'object');
appstore.getSubscription(function (error, result) {
if (error && error.reason === AppstoreError.ALREADY_EXISTS) return next(new HttpError(409, error.message));
if (error && error.reason === AppstoreError.EXTERNAL_ERROR) return next(new HttpError(424, error.message));
if (error) return next(new HttpError(500, error));