Skip to content

best way to save what you love

api/twitter: update no tweet error code

wukko37efa035a285
diff --git a/api/src/processing/services/twitter.js b/api/src/processing/services/twitter.js
index bc253774..d45ff713 100644
--- a/api/src/processing/services/twitter.js
+++ b/api/src/processing/services/twitter.js
@@ -119,6 +119,10 @@ export default async function({ id, index, toGif, dispatcher }) {
let tweetTypename = tweet?.data?.tweetResult?.result?.__typename;
+ if (!tweetTypename) {
+ return { error: "fetch.empty" }
+ }
+
if (tweetTypename === "TweetUnavailable") {
const reason = tweet?.data?.tweetResult?.result?.reason;
switch(reason) {
@@ -133,10 +137,6 @@ export default async function({ id, index, toGif, dispatcher }) {
}
}
- if (!tweetTypename) {
- return { error: "link.invalid" }
- }
-
if (!["Tweet", "TweetWithVisibilityResults"].includes(tweetTypename)) {
return { error: "content.post.unavailable" }
}