Update enums to be all caps (#12372)
- Make custom domain public (remove from lab) - Use ALL_CAPS definition for enums
This commit is contained in:
@ -19,21 +19,21 @@ export const exceptionHandlerModuleFactory = async (
|
||||
const driverType = twentyConfigService.get('EXCEPTION_HANDLER_DRIVER');
|
||||
|
||||
switch (driverType) {
|
||||
case ExceptionHandlerDriver.Console: {
|
||||
case ExceptionHandlerDriver.CONSOLE: {
|
||||
return {
|
||||
type: ExceptionHandlerDriver.Console,
|
||||
type: ExceptionHandlerDriver.CONSOLE,
|
||||
};
|
||||
}
|
||||
case ExceptionHandlerDriver.Sentry: {
|
||||
case ExceptionHandlerDriver.SENTRY: {
|
||||
return {
|
||||
type: ExceptionHandlerDriver.Sentry,
|
||||
type: ExceptionHandlerDriver.SENTRY,
|
||||
options: {
|
||||
environment: twentyConfigService.get('SENTRY_ENVIRONMENT'),
|
||||
release: twentyConfigService.get('APP_VERSION'),
|
||||
dsn: twentyConfigService.get('SENTRY_DSN') ?? '',
|
||||
serverInstance: adapterHost.httpAdapter?.getInstance(),
|
||||
debug:
|
||||
twentyConfigService.get('NODE_ENV') === NodeEnvironment.development,
|
||||
twentyConfigService.get('NODE_ENV') === NodeEnvironment.DEVELOPMENT,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ export class ExceptionHandlerModule extends ConfigurableModuleClass {
|
||||
const provider = {
|
||||
provide: EXCEPTION_HANDLER_DRIVER,
|
||||
useValue:
|
||||
options.type === ExceptionHandlerDriver.Console
|
||||
options.type === ExceptionHandlerDriver.CONSOLE
|
||||
? new ExceptionHandlerConsoleDriver()
|
||||
: new ExceptionHandlerSentryDriver(),
|
||||
};
|
||||
@ -45,7 +45,7 @@ export class ExceptionHandlerModule extends ConfigurableModuleClass {
|
||||
return null;
|
||||
}
|
||||
|
||||
return config.type === ExceptionHandlerDriver.Console
|
||||
return config.type === ExceptionHandlerDriver.CONSOLE
|
||||
? new ExceptionHandlerConsoleDriver()
|
||||
: new ExceptionHandlerSentryDriver();
|
||||
},
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
import { Router } from 'express';
|
||||
|
||||
export enum ExceptionHandlerDriver {
|
||||
Sentry = 'sentry',
|
||||
Console = 'console',
|
||||
SENTRY = 'SENTRY',
|
||||
CONSOLE = 'CONSOLE',
|
||||
}
|
||||
|
||||
export interface ExceptionHandlerSentryDriverFactoryOptions {
|
||||
type: ExceptionHandlerDriver.Sentry;
|
||||
type: ExceptionHandlerDriver.SENTRY;
|
||||
options: {
|
||||
environment?: string;
|
||||
release?: string;
|
||||
@ -17,7 +17,7 @@ export interface ExceptionHandlerSentryDriverFactoryOptions {
|
||||
}
|
||||
|
||||
export interface ExceptionHandlerDriverFactoryOptions {
|
||||
type: ExceptionHandlerDriver.Console;
|
||||
type: ExceptionHandlerDriver.CONSOLE;
|
||||
}
|
||||
|
||||
export type ExceptionHandlerModuleOptions =
|
||||
|
||||
Reference in New Issue
Block a user