Refactor toHttpError code into BoxError
This commit is contained in:
@@ -44,7 +44,7 @@ function enableRemoteSupport(req, res, next) {
|
||||
if (typeof req.body.enable !== 'boolean') return next(new HttpError(400, 'enabled is required'));
|
||||
|
||||
support.enableRemoteSupport(req.body.enable, function (error) {
|
||||
if (error) return next(new HttpError(500, error));
|
||||
if (error) return next(new HttpError(503, 'Error enabling remote support. Try running "cloudron-support --enable-ssh" on the server'));
|
||||
|
||||
next(new HttpSuccess(202, {}));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user