-
-
Notifications
You must be signed in to change notification settings - Fork 284
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
Fail Gracefully on deep query errors #186
Comments
This feature was requested in GH-112 and discussed in several other issues, including GH-47. This is something I have been thinking to work on for a while, but never had the time to do that. Basically, my idea was to be able to provide an option to limit the query dept (normally you might want to limit it to 1, since AFAIK no query goes further than 2 steps). Also, it would be cool to be able to access partial responses in case of failure. Honestly, I think we are talking about two different features that are closely related each other. |
I think #47 is closer to what's going on here, though both items would be useful. The problem here is that we're assuming (and you would think that the whois server reported by the registry would at least be a an address that can resolve) that the whois server is a valid address. IMO we should rescue from this particular error and return false from However, a connection might behave the same way if your DNS wasn't responding (or with no network connection at all), but if a lookup for the registry succeeds immediately following a failure by the registrar that probably isn't the case. |
The problem is that the only way to be sure the referral works, is to execute a socket connection and rescue the error. Honestly, I don't mind which kind of error occurs: it can be a connection failure, a socket error, a socket reset... etc. The result is the same: the second request fails but we already have a partial response. I'm thinking about how to deal with it. If you ever read @avdi's book Exceptional Ruby (that I totally recommend), there are two concepts I think that we can apply here: tagged exceptions and nested exceptions. The exception architecture in the We may use the connection tagging to determine whether a specific exception embeds any response and nest into the exception itself the reference to the partial response, in case any exists. More or less like ActiveRecord does in case of validation error (it keeps a reference to the invalid object). This is just brainstorming, but it summarizes more or less the idea I had in mind for such feature. |
Any progress on this? It would be a great addition to a great gem. |
Doing a whois query to a domain with the gooddomains.com registrar raises:
Because when doing the registrar lookup to whois.gooddomains.com the address does not resolve.
Should errors like these (where the advertised whois server address does not resolve) be rescued so we can still have a record with the registrar data?
The text was updated successfully, but these errors were encountered: