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 handling of rejected promises when attempting to close the server #277

Merged
merged 1 commit into from
Mar 17, 2022

Conversation

Codex-
Copy link
Contributor

@Codex- Codex- commented Mar 14, 2022

Current:

function bail(e?: Error) {
  try {
    returnserver.close();
  } catch (err) {
    console.warn('unable to close vite server');
  }

  throw e;
}

If this call to server.close() throws, then it does not get caught by the catch here as the promise is not awaited. For this catch to handle the rejection of this promise, the server.close() call needs to be awaited

@IanVS
Copy link
Member

IanVS commented Mar 17, 2022

Thanks!

@IanVS IanVS merged commit abe3efd into storybookjs:main Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants