Skip to content

Commit

Permalink
[units] Catch unhanlded exception if no user input
Browse files Browse the repository at this point in the history
* Catch two unhandled exceptions in distance and temp if the user
specified no input.
  • Loading branch information
Erethon committed Mar 13, 2014
1 parent 72a43e5 commit eac11c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions units.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def temperature(bot, trigger):
"""
try:
source = find_temp.match(trigger.group(2)).groups()
except AttributeError:
except (AttributeError, TypeError):
bot.reply("That's not a valid temperature.")
return NOLIMIT
unit = source[1].upper()
Expand Down Expand Up @@ -71,7 +71,7 @@ def distance(bot, trigger):
"""
try:
source = find_length.match(trigger.group(2)).groups()
except AttributeError:
except (AttributeError, TypeError):
bot.reply("That's not a valid length unit.")
return NOLIMIT
unit = source[1].lower()
Expand Down

0 comments on commit eac11c3

Please sign in to comment.