Handle errors if domain is still used on deletion attempt
This commit is contained in:
@@ -77,6 +77,7 @@ function del(req, res, next) {
|
||||
|
||||
domains.del(req.params.domain, function (error) {
|
||||
if (error && error.reason === DomainError.NOT_FOUND) return next(new HttpError(404, error.message));
|
||||
if (error && error.reason === DomainError.IN_USE) return next(new HttpError(409, 'Domain is still in use'));
|
||||
if (error) return next(new HttpError(500, error));
|
||||
|
||||
next(new HttpSuccess(204, {}));
|
||||
|
||||
Reference in New Issue
Block a user