Skip to content

Commit

Permalink
Don't hide Timeout on errors from underying net conn.
Browse files Browse the repository at this point in the history
  • Loading branch information
garyburd committed Nov 7, 2014
1 parent 7d2ea39 commit ea78a26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ var (

func hideTempErr(err error) error {
if e, ok := err.(net.Error); ok && e.Temporary() {
err = struct{ error }{err}
err = &netError{msg: e.Error(), timeout: e.Timeout()}
}
return err
}
Expand Down

2 comments on commit ea78a26

@hraban
Copy link

@hraban hraban commented on ea78a26 Nov 7, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi gary,

This does solve the problem from efd7f76#commitcomment-8469746

Which is great, thanks!

A question: do I understand correctly that this code is now essentially just setting e.Temporary to false, nothing else? It would make sense, given the function name.

I just don't exactly understand why it's happening, since I'm not very familiar with how one is supposed to handle e.Temporary() == true, anyway.

@garyburd
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's forcing err.Temporary() to false and nothing else.

Please sign in to comment.