Check if Cloudron is already registered

This commit is contained in:
Girish Ramakrishnan
2019-05-06 19:46:42 -07:00
parent ffe0e6dbbe
commit bbced03f3a
2 changed files with 10 additions and 4 deletions

View File

@@ -66,6 +66,7 @@ function registerCloudron(req, res, next) {
appstore.registerCloudron(req.body, function (error) {
if (error && error.reason === AppstoreError.ALREADY_EXISTS) return next(new HttpError(409, error.message));
if (error && error.reason === AppstoreError.ACCESS_DENIED) return next(new HttpError(412, error.message));
if (error && error.reason === AppstoreError.ALREADY_REGISTERED) return next(new HttpError(422, error.message));
if (error && error.reason === AppstoreError.EXTERNAL_ERROR) return next(new HttpError(424, error.message));
if (error) return next(new HttpError(500, error));