Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): auto flush logs on synchronous internal errors #13405

Merged
merged 2 commits into from
Jun 3, 2024

Conversation

micalevisk
Copy link
Member

@micalevisk micalevisk commented Apr 7, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Issue Number: closes #13400

What is the new behavior?

For the following code

import { NestFactory } from '@nestjs/core'
import { AppModule } from './app.module' // no-op module

async function bootstrap() {
  const app = await NestFactory.create(AppModule, {
    bufferLogs: true,
    autoFlushLogs: true,
  });
  app.get('foo')
  await app.listen(3000);
}

bootstrap();

we'll see the following error:

image

Do note that if autoFlushLogs is false, no logs will be shown for the above code.

Does this PR introduce a breaking change?

  • Yes
  • No

@coveralls
Copy link

Pull Request Test Coverage Report for Build 7aab33f9-738b-4c84-a4cb-bbe8a92bad8a

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.123%

Totals Coverage Status
Change from base Build eacd3e56-4bed-4f5e-9bab-412a10335aab: 0.0%
Covered Lines: 6736
Relevant Lines: 7312

💛 - Coveralls

@kamilmysliwiec kamilmysliwiec merged commit e93cf43 into nestjs:master Jun 3, 2024
5 checks passed
@micalevisk micalevisk deleted the feat/issue-13400 branch June 3, 2024 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Log is not auto-flushed on error during initialization
3 participants