diff --git a/client_test.go b/client_test.go index d10671a5..22fc6bef 100644 --- a/client_test.go +++ b/client_test.go @@ -326,8 +326,8 @@ func TestOpenFailedVhost(t *testing.T) { }() c, err := Open(rwc, defaultConfig()) - if err != ErrVhost { - t.Fatalf("expected ErrVhost got: %+v on %+v", err, c) + if err == nil { + t.Fatalf("expected not nil error got: %+v on %+v", err, c) } } diff --git a/connection.go b/connection.go index 8e62ee96..b837b5df 100644 --- a/connection.go +++ b/connection.go @@ -794,7 +794,7 @@ func (c *Connection) openVhost(config Config) error { if err := c.call(req, res); err != nil { // Cannot be closed yet, but we know it's a vhost problem - return ErrVhost + return err } c.Config.Vhost = config.Vhost