mylife: catch IOError too

master
mutantmonkey 2011-09-21 20:54:47 -04:00
parent f34695717d
commit 06133ef0c3
1 changed files with 10 additions and 10 deletions

View File

@ -16,7 +16,7 @@ def fml(phenny, input):
""".fml""" """.fml"""
try: try:
req = web.get("http://www.fmylife.com/random") req = web.get("http://www.fmylife.com/random")
except HTTPError: except HTTPError, IOError:
phenny.say("I tried to use .fml, but it was broken. FML") phenny.say("I tried to use .fml, but it was broken. FML")
return return
@ -29,7 +29,7 @@ def mlia(phenny, input):
""".mlia - My life is average.""" """.mlia - My life is average."""
try: try:
req = web.get("http://mylifeisaverage.com/") req = web.get("http://mylifeisaverage.com/")
except HTTPError: except HTTPError, IOError:
phenny.say("I tried to use .mlia, but it wasn't loading. MLIA") phenny.say("I tried to use .mlia, but it wasn't loading. MLIA")
return return
@ -43,7 +43,7 @@ def mliarab(phenny, input):
""".mliarab - My life is Arabic.""" """.mliarab - My life is Arabic."""
try: try:
req = web.get("http://mylifeisarabic.com/random/") req = web.get("http://mylifeisarabic.com/random/")
except HTTPError: except HTTPError, IOError:
phenny.say("The site you requested, mylifeisarabic.com, has been banned \ phenny.say("The site you requested, mylifeisarabic.com, has been banned \
in the UAE. You will be reported to appropriate authorities") in the UAE. You will be reported to appropriate authorities")
return return
@ -59,7 +59,7 @@ def mlib(phenny, input):
""".mlib - My life is bro.""" """.mlib - My life is bro."""
try: try:
req = web.get("http://mylifeisbro.com/random") req = web.get("http://mylifeisbro.com/random")
except HTTPError: except HTTPError, IOError:
phenny.say("MLIB is out getting a case of Natty. It's chill.") phenny.say("MLIB is out getting a case of Natty. It's chill.")
return return
@ -72,7 +72,7 @@ def mlic(phenny, input):
""".mlic - My life is creepy.""" """.mlic - My life is creepy."""
try: try:
req = web.get("http://mylifeiscreepy.com/random") req = web.get("http://mylifeiscreepy.com/random")
except HTTPError: except HTTPError, IOError:
phenny.say("Error: Have you checked behind you?") phenny.say("Error: Have you checked behind you?")
return return
@ -86,7 +86,7 @@ def mlid(phenny, input):
""".mlib - My life is Desi.""" """.mlib - My life is Desi."""
try: try:
req = web.get("http://www.mylifeisdesi.com/random") req = web.get("http://www.mylifeisdesi.com/random")
except HTTPError: except HTTPError, IOError:
phenny.say("MLID is busy at the hookah lounge, be back soon.") phenny.say("MLID is busy at the hookah lounge, be back soon.")
return return
@ -99,7 +99,7 @@ def mlig(phenny, input):
""".mlig - My life is ginger.""" """.mlig - My life is ginger."""
try: try:
req = web.get("http://www.mylifeisginger.org/random") req = web.get("http://www.mylifeisginger.org/random")
except HTTPError: except HTTPError, IOError:
phenny.say("Busy eating your soul. Be back soon.") phenny.say("Busy eating your soul. Be back soon.")
return return
@ -112,7 +112,7 @@ def mlih(phenny, input):
""".mlih - My life is ho.""" """.mlih - My life is ho."""
try: try:
req = web.get("http://mylifeisho.com/random") req = web.get("http://mylifeisho.com/random")
except HTTPError: except HTTPError, IOError:
phenny.say("MLIH is giving some dome to some lax bros.") phenny.say("MLIH is giving some dome to some lax bros.")
return return
@ -125,7 +125,7 @@ def mlihp(phenny, input):
""".mlihp - My life is Harry Potter.""" """.mlihp - My life is Harry Potter."""
try: try:
req = web.get("http://www.mylifeishp.com/random") req = web.get("http://www.mylifeishp.com/random")
except HTTPError: except HTTPError, IOError:
phenny.say("This service is not available to Muggles.") phenny.say("This service is not available to Muggles.")
return return
@ -138,7 +138,7 @@ def mlit(phenny, input):
""".mlit - My life is Twilight.""" """.mlit - My life is Twilight."""
try: try:
req = web.get("http://mylifeistwilight.com/random") req = web.get("http://mylifeistwilight.com/random")
except HTTPError: except HTTPError, IOError:
phenny.say("Error: Your life is too Twilight. Go outside.") phenny.say("Error: Your life is too Twilight. Go outside.")
return return