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

how to check connection #340

Open
ehooi opened this issue Jul 17, 2024 · 0 comments
Open

how to check connection #340

ehooi opened this issue Jul 17, 2024 · 0 comments

Comments

@ehooi
Copy link
Contributor

ehooi commented Jul 17, 2024

Initially, I tried await client.checkHealth().
However, I couldn't catch any errors.
It caused the process to crash due to an unhandled promise rejection.

This happened because it does not await this.connectPromise, whereas checkCompatibility() does.

I believe there are currently two ways to check connection:

  1. await client.connectPromise
  2. await client.checkCompatibility()

However, I think await client.checkHealth() is the most intuitive way.

Therefore, I propose the following.
a. add documentation on how to check connection.
b. modify checkHealth() to await connectPromise internally.
c. change the API to explicitly establish a connection, for example: await client.connect()

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

No branches or pull requests

1 participant