Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel committed Jun 28, 2024
1 parent f08cb9a commit 110fe22
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/policy-engine/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { PolicyEngineModule, ProvisionModule } from './policy-engine.module'
import { ApplicationExceptionFilter } from './shared/filter/application-exception.filter'
import { HttpExceptionFilter } from './shared/filter/http-exception.filter'

const logger = new LoggerService()

/**
* Adds global pipes to the application.
*
Expand All @@ -31,7 +33,10 @@ const withGlobalPipes = (app: INestApplication): INestApplication => {
const withGlobalFilters =
(configService: ConfigService<Config>) =>
(app: INestApplication): INestApplication => {
app.useGlobalFilters(new HttpExceptionFilter(configService), new ApplicationExceptionFilter(configService))
app.useGlobalFilters(
new HttpExceptionFilter(configService, logger),
new ApplicationExceptionFilter(configService, logger)
)

return app
}
Expand All @@ -47,7 +52,6 @@ async function bootstrap() {
// a temporary application for the provision step.
await provision()

const logger = new LoggerService()
const application = await NestFactory.create(PolicyEngineModule, { bufferLogs: true, bodyParser: true })
const configService = application.get(ConfigService<Config>)
const port = configService.get('port')
Expand Down

0 comments on commit 110fe22

Please sign in to comment.