Skip to content

Commit

Permalink
throw CriticalError instead of procees.exit
Browse files Browse the repository at this point in the history
Signed-off-by: Hailong Cui <[email protected]>
  • Loading branch information
Hailong-am committed Mar 26, 2024
1 parent dfa03fd commit 9e484d9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import { first } from 'rxjs/operators';
import { Observable } from 'rxjs';
import { CriticalError } from '../../../src/core/server/errors';
import {
PluginInitializerContext,
CoreSetup,
Expand Down Expand Up @@ -148,10 +149,10 @@ export class SecurityPlugin
);

if (workspace && config.multitenancy?.enabled && dashboardsInfo.multitenancy_enabled) {
this.logger.error(
'Both workspace and multi-tenancy features are enabled, only one of them can be enabled at the same time.'
);
process.exit(1);
const message =
'Both workspace and multi-tenancy features are enabled, only one of them can be enabled at the same time.';
this.logger.error(message);
throw new CriticalError(message, 'InvalidConfig', 64);
}

// set up multi-tenant routes
Expand Down

0 comments on commit 9e484d9

Please sign in to comment.