Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce structure for errors #7

Merged
merged 2 commits into from
Apr 13, 2018
Merged

Conversation

astj
Copy link
Collaborator

@astj astj commented Apr 12, 2018

By introducing those structures, caller can detect for which reason the dialer returned an error.

@astj astj force-pushed the structurize-error branch from c82c87c to 1792acb Compare April 12, 2018 02:24
Copy link
Owner

@hakobe hakobe left a comment

Choose a reason for hiding this comment

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

LGTM ✌️

@hakobe hakobe merged commit 425cb61 into hakobe:master Apr 13, 2018
@Songmu
Copy link
Collaborator

Songmu commented Apr 14, 2018

I think IsBadIP is not good naming, which reminds me of "really" bad IP like 999.999.1.1.

How about IsInternalIP?

In either case, thinking a little more about the interface, it may be better to revert this pull request once.

@astj
Copy link
Collaborator Author

astj commented Apr 16, 2018

paranoidhttp blocks not only internal IPs (like 6to4): https://github.com/hakobe/paranoidhttp/blob/master/client.go#L171-L174
I didn't have a good idea to represent the error, so I chose BadIP.

Songmu added a commit that referenced this pull request Mar 30, 2019
## [v0.1.0](6495e87...v0.1.0) (2019-03-31)

* adjust releng files [#11](#11) ([Songmu](https://github.com/Songmu))
* Revert "introduce structure for errors" [#8](#8) ([hakobe](https://github.com/hakobe))
* introduce structure for errors [#7](#7) ([astj](https://github.com/astj))
* Remove resolved issues from readme. [#6](#6) ([shogo82148](https://github.com/shogo82148))
* fix errors in IPv6 environment. [#5](#5) ([shogo82148](https://github.com/shogo82148))
* [incompatible] Support context more on Go 1.8 [#4](#4) ([Songmu](https://github.com/Songmu))
* support DialContext for go 1.7 [#3](#3) ([Songmu](https://github.com/Songmu))
* define mustParseCIDR and refactor [#2](#2) ([Songmu](https://github.com/Songmu))
* To prevent TOCTOU attacks, use checked IP addr directly for connections [#1](#1) ([hakobe](https://github.com/hakobe))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants