benschw / srv-lb

GNU General Public License v3.0
49 stars 9 forks source link

SRV lookup does not report inner DNS error when unable to connect to registry #6

Open vassilvk opened 6 years ago

vassilvk commented 6 years ago

When trying to obtain a SRV record from a registry using bad DNS address, method LoadBalancer.Next() fails to report the actual error. It simply states that Couldn't resolve name 'my-service.service.consul.'.

This obscures the reason for the error and makes it look like the issue is caused by a missing SRV record, while the actual reason is inability to connect to the registry.

A more informative and go-idiomatic error message would concatenate the inner error.

Here are examples of what this might look like in a real world scenario: