1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-27 15:41:45 +01:00

chore: improves errors

This commit is contained in:
Amir Raminfar
2024-07-10 17:11:35 -07:00
parent 208671ef23
commit 8277902020

View File

@@ -47,14 +47,14 @@ func NewClient(endpoint string, certificates tls.Certificate, opts ...grpc.DialO
opts = append(opts, grpc.WithTransportCredentials(creds))
conn, err := grpc.NewClient(endpoint, opts...)
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to connect to %s: %w", endpoint, err)
}
client := pb.NewAgentServiceClient(conn)
info, err := client.HostInfo(context.Background(), &pb.HostInfoRequest{})
if err != nil {
conn.Close()
return nil, err
return nil, fmt.Errorf("failed to get host info: %w", err)
}
return &Client{