Created
September 21, 2014 20:08
-
-
Save ae6rt/38b23e9ed90f752851f6 to your computer and use it in GitHub Desktop.
Examine specific network errors in Go for more failure information
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if err, ok := err.(net.Error); ok { | |
if err.Timeout() { | |
responseCode = http.StatusGatewayTimeout | |
fmt.Printf("Timeout\n") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment