Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
We should only get `socket.gaierror` if the user passes an invalid IP or hostname, but it could be in the event that we don't have DNS configured on the machine or a multitude of other things, so we can be somewhat vague in the error message.
  • Loading branch information
maxpowa committed Nov 23, 2015
1 parent 48b6631 commit 5d9e95b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sopel/modules/ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ def ip(bot, trigger):
response += " | Location: %s" % gi_city.country_name_by_name(query)
except AttributeError:
response += ' | Location: Unknown'
except socket.gaierror:
return bot.say('[IP/Host Lookup] Unable to resolve IP/Hostname')

region_data = gi_city.region_by_name(query)
try:
Expand Down

0 comments on commit 5d9e95b

Please sign in to comment.