diff --git a/client.go b/client.go index 3babe2919..70cb18047 100644 --- a/client.go +++ b/client.go @@ -61,10 +61,11 @@ func NewClient(host string, options *ClientOptions) (*Client, error) { return nil, err } - return NewClientFromURI(uri, options) + client := NewClientFromURI(uri, options) + return client, nil } -func NewClientFromURI(defaultURI *URI, options *ClientOptions) (*Client, error) { +func NewClientFromURI(defaultURI *URI, options *ClientOptions) *Client { if options == nil { options = &ClientOptions{} } @@ -76,7 +77,7 @@ func NewClientFromURI(defaultURI *URI, options *ClientOptions) (*Client, error) return &Client{ defaultURI: defaultURI, HTTPClient: client, - }, nil + } } // Host returns the host the client was initialized with. diff --git a/executor.go b/executor.go index 8d70cb2f1..7aee4e472 100644 --- a/executor.go +++ b/executor.go @@ -55,12 +55,8 @@ func NewExecutor(clientOptions *ClientOptions) (*Executor, error) { if clientOptions == nil { clientOptions = &ClientOptions{} } - client, err := NewClientFromURI(nil, clientOptions) - if err != nil { - return nil, err - } return &Executor{ - client: client, + client: NewClientFromURI(nil, clientOptions), }, nil } diff --git a/handler.go b/handler.go index 016e3a348..811ab14f1 100644 --- a/handler.go +++ b/handler.go @@ -1506,11 +1506,7 @@ func (h *Handler) handlePostFrameRestore(w http.ResponseWriter, r *http.Request) } // Create a client for the remote cluster. - client, err := NewClientFromURI(host, h.ClientOptions) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } + client := NewClientFromURI(host, h.ClientOptions) // Determine the maximum number of slices. maxSlices, err := client.MaxSliceByIndex(r.Context())