likexian / whois

Whois client for domain and ip whois information query in Go(Golang).
Apache License 2.0
382 stars 70 forks source link

Error Updates #19

Closed gabe565 closed 2 years ago

gabe565 commented 3 years ago

Hello!

I really appreciate your work on this repo.
This pull request makes two changes to the way errors are handled in this repo.

  1. Detecting which error has occurred with errors.Is() is not possible unless errors are formatted with %w instead of %v. See here for more detail.
  2. Splitting out some of the local errors into public variables (ErrDomainEmpty and ErrWhoisServerNotFound) will let callers check to see if one of these errors occurred. For example errors.Is(err, whois.ErrWhoisServerNotFound)
likexian commented 2 years ago

Hello @gabe565 Thanks for your works, I will merge it.


If you think this repository is helpful, please share it with friends, thanks.