diff --git a/client.go b/client.go index 2ee8c9c1..a2a37628 100644 --- a/client.go +++ b/client.go @@ -90,6 +90,7 @@ func Connect(endpoints string, tlsConfig *tls.Config) (*OvsdbClient, error) { } func newRPC2Client(conn net.Conn) (*OvsdbClient, error) { + var errors []string c := rpc2.NewClientWithCodec(jsonrpc.NewJSONCodec(conn)) c.SetBlocking(true) c.Handle("echo", echo) @@ -114,9 +115,12 @@ func newRPC2Client(conn net.Conn) (*OvsdbClient, error) { ovs.Apis[db] = NewNativeAPI(schema) } else { c.Close() - return nil, err + errors = append(errors, err.Error()) } } + if len(errors) > 0 { + return nil, fmt.Errorf("Multiple DB Errors: %s", strings.Join(errors, ",")) + } connectionsMutex.Lock() defer connectionsMutex.Unlock()