fix errors resulting from null keys

This commit is contained in:
Shane Caraveo 2010-11-05 14:36:35 -07:00
Родитель d5a9307884
Коммит 9c38361333
1 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -112,7 +112,16 @@ The 'send' namespace is used to send updates to our supported services.
args['shorturl'] = shorturl
# send the item.
result, error = provider.api(acct).sendmessage(message, args)
try:
result, error = provider.api(acct).sendmessage(message, args)
except ValueError, e:
# XXX we need to handle this better, but if for some reason the
# oauth values are bad we will get a ValueError raised
error = {'provider': domain,
'message': "not logged in or no user account for that domain",
'status': 401
}
return {'result': result, 'error': error}
if error:
assert not result