> if err, ok := err.(*url.Error); ok {
> if err, ok := err.Err.(*net.OpError); ok {
> if err, ok := err.Err.(*net.DNSError); ok {
> fmt.Println("DNS ERROR:", err)
> }
> }
> }

This works as expected. :-)

On Monday, November 28, 2016 at 9:32:55 PM UTC+1, Dave Cheney wrote:
> Indeed. Does your program differentiate between a URL not resolving, the 
> webserver at the other end being down or refusing to connect, or it 
> returnining a non temporary fatal error, 4xx? 

Yes, it tries to be verbose about failure reasons. DNS / Server not 
listening / HTTP Status codes if present.. 

You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to