We are all aware error handling was tied for 4th most common challenging 
when working with Go in the 2018 survey.

There is not description of what about error handling. I'm sure I missed 
the conversation but how did we get to the point of deciding it was the if 
err!=nil that was the "challenging part"?

Personally the only thing I wish was different was we could have error 
times/categories in addion. Basically just a way to allow us to not need 
the following.

if strings.Contains(err.Err(),"timeout")

Most of the time all you care is there was an error and don't parse the 
message to decide what to do next. There are cases where you might decide 
how to handle it based on the message.

There are messages like "Connection failed to -> 192.168.1.1", this is 
useful but also makes the error something you can't check for without 
substring parsing.

What if we could do something like

if err.Type()=="Bad Connection"

but then you could still return or log the 'err' as normal and get that 
extra info.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/fa12d854-c317-4477-98b1-32ca883d2093%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to