You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when I used a a http.Get(url) to a location that is not public accessible, I get a net.DNSError. I am trying to catch that error, and tried to use errors.Is but this seemed to fail.
My current workarounds:
remove test url.Error instead (not ideal)
unwrap to the level I need and test for net.DNSError
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
this is the latest release on brew, so I would say yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
when I used a a
http.Get(url)
to a location that is not public accessible, I get a net.DNSError. I am trying to catch that error, and tried to useerrors.Is
but this seemed to fail.My current workarounds:
you can see the code here..
https://play.golang.org/p/hl9bbhQnL2i
if you comment section 3 you will see section 4 succeed aswell.
What did you expect to see?
I expect
errors.Is
to work for me or at lest to find a documentation for how to make it workWhat did you see instead?
I see I need to use the unwrapping and testing myself
The text was updated successfully, but these errors were encountered: