I do not get how one can handle errors receiving from the net package. I need to know what kind of error occurred to do the next step. Trying to parse the error message string is probably not the right way...
response, err := data.httpClient.Get("https://" + domain)
if err != nil {
fmt.Println("[!] error: ", err)
/*
* I want something like this in pseudo code:
* if error == DnsLookupError {
* action1()
* } else if error == TlsCertificateError {
* action2()
* } else if error == Timeout {
* action3()
* } ...
*/
}
Error messages I receive for example:
Get "https://example1.com": remote error: tls: internal error
Get "https://example2.com": dial tcp: lookup example2.com
etc.