Skip to content

Conversation

addaleax
Copy link
Collaborator

No description provided.

const err = new MongoshInterruptedError();
for (const listener of [...this.onInterruptListeners]) {
listener(err);
await listener(err);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to catch any errors that the listener might throw so all listeners will always be notified?

try {
  await listener(err);
} catch {
  // ignore
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that seems like a good idea 👍

Copy link
Contributor

@shaketbaby shaketbaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for doing this 👍

@addaleax
Copy link
Collaborator Author

@addaleax addaleax merged commit b7eb96e into feat-MONGOSH-1514-atlas-streams Aug 28, 2023
@addaleax addaleax deleted the interrupt-handling branch August 28, 2023 12:19
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