Skip to content

client.connect() returns misleading error #93

Open
@Herald85

Description

@Herald85

I'm working with Docker on W10 and it takes DB a bit longer to start than my app container and I was getting Error: connect ECONNREFUSED... from client.connect(). I wanted to solve it with a timer loop with try to connect every 1 second again, but each other call of client.connect() returned an error Client has already been connected.... And that was not true, DB still hasn't started and any query called on such client ended with an error. What I had to do was to close the client and create a completely new instance on which I could try to call connect again.

My points are:

  • connect should be allowed to be called multiple times on one instance if the previous call ended with connection error
  • even if that is not wanted, the error message should not say Client has already been connected, when it is not true (again DB has not yet started)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions