Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Graceful handling of unwieldly links in fedmsg-tweet.

  • Loading branch information...
commit e8d81e67bdbe650ef7bef66d4f4b01d778082814 1 parent 9fd8e79
@ralphbean authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 fedmsg/commands/tweet.py
View
7 fedmsg/commands/tweet.py
@@ -100,7 +100,12 @@ def _post_to_api(api, message):
link = fedmsg.meta.msg2link(msg, **self.config)
if link:
- link = bitly.shorten(longUrl=link)['url']
+ try:
+ link = bitly.shorten(longUrl=link)['url']
+ except Exception:
+ self.log.warn("Bad URI for bitly %r" %link)
+ link = ""
+
message = message[:138 - len(link)] + " " + link
else:
message = message[:140]
Please sign in to comment.
Something went wrong with that request. Please try again.