Skip to content

Commit

Permalink
fix: correct Err type
Browse files Browse the repository at this point in the history
  • Loading branch information
sumitanvekar committed Jun 13, 2023
1 parent 21acd29 commit 23ebdc4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/pkg/grpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package grpc

import (
"bytes"
"errors"
"fmt"
"google.golang.org/grpc/credentials/insecure"
"log"
Expand Down Expand Up @@ -124,7 +125,7 @@ func (c *Client) SendRequest(serviceMethod string, message string, headers []str

if c.conn == nil {
log.Printf("No connection available. Skip making request.")
return response.Response{Duration: time.Duration(0), Err: err, Type: respType}
return response.Response{Duration: time.Duration(0), Err: errors.New("no connection available"), Type: respType}
}

err = grpcurl.InvokeRPC(context.Background(), c.descriptorSource, c.conn, serviceMethod, interpolatedHeaders, loggingEventHandler, requestParser.Next)
Expand Down

0 comments on commit 23ebdc4

Please sign in to comment.