Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

markdown: Treat more twitter codes as also permanent failures.

Alex Vandiver03ca3afbc231
diff --git a/zerver/lib/markdown/__init__.py b/zerver/lib/markdown/__init__.py
index 4d38bfe3d85..ac9b1f74bdb 100644
--- a/zerver/lib/markdown/__init__.py
+++ b/zerver/lib/markdown/__init__.py
@@ -413,9 +413,10 @@ def fetch_tweet_data(tweet_id: str) -> Optional[Dict[str, Any]]:
t = e.args[0]
if len(t) == 1 and ('code' in t[0]):
code = t[0]['code']
- if code == 34:
- # Code 34 means that the message doesn't exist; return
- # None so that we will cache the error
+ if code in [34, 144, 421, 422]:
+ # All these "correspond with HTTP 404," and mean
+ # that the message doesn't exist; return None so
+ # that we will cache the error.
return None
elif code in [88, 130]:
# Code 88 means that we were rate-limited and 130