Use BAD_STATE consistently for demo mode

This commit is contained in:
Girish Ramakrishnan
2024-01-13 21:15:41 +01:00
parent a007a8e40c
commit 46a589f794
6 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -83,7 +83,7 @@ async function startPrepareLocation(domain, auditSource) {
debug(`prepareLocation: ${domain}`);
if (constants.DEMO) throw new BoxError(BoxError.CONFLICT, 'Not allowed in demo mode');
if (constants.DEMO) throw new BoxError(BoxError.BAD_STATE, 'Not allowed in demo mode');
const fqdn = dns.fqdn(constants.DASHBOARD_SUBDOMAIN, domain);
const result = await apps.list();
@@ -118,7 +118,7 @@ async function setupLocation(subdomain, domain, auditSource) {
debug(`setupLocation: ${domain}`);
if (constants.DEMO) throw new BoxError(BoxError.CONFLICT, 'Not allowed in demo mode');
if (constants.DEMO) throw new BoxError(BoxError.BAD_STATE, 'Not allowed in demo mode');
await reverseProxy.writeDashboardConfig(domain);
await setLocation(subdomain, domain);