Skip to content

Commit

Permalink
Update string for bluesky post not found
Browse files Browse the repository at this point in the history
  • Loading branch information
dangeredwolf committed Nov 14, 2024
1 parent d1ebdc7 commit 34ed25b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/embed/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,23 @@ export const handleStatus = async (
}

if (status === null) {
return returnError(c, Strings.ERROR_TWEET_NOT_FOUND);
if (provider === DataProvider.Bsky) {
return returnError(c, Strings.ERROR_BLUESKY_POST_NOT_FOUND);
} else {
return returnError(c, Strings.ERROR_TWEET_NOT_FOUND);
}
}

/* If there was any errors fetching the Tweet, we'll return it */
switch (api.code) {
case 401:
return returnError(c, Strings.ERROR_PRIVATE);
case 404:
return returnError(c, Strings.ERROR_TWEET_NOT_FOUND);
if (provider === DataProvider.Bsky) {
return returnError(c, Strings.ERROR_BLUESKY_POST_NOT_FOUND);
} else {
return returnError(c, Strings.ERROR_TWEET_NOT_FOUND);
}
case 500:
console.log(api);
return returnError(c, Strings.ERROR_API_FAIL);
Expand Down
1 change: 1 addition & 0 deletions src/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ This may be caused by API downtime or a new bug. Try again in a little while." p
'Post failed to load due to an API error. The account may be private or suspended, or there may be another issue :(',
ERROR_PRIVATE: `Sorry, we can't embed this post because the user is private or suspended :(`,
ERROR_TWEET_NOT_FOUND: `Sorry, that post doesn't exist :(`,
ERROR_BLUESKY_POST_NOT_FOUND: `Sorry, that post doesn't exist or Bluesky's servers are currently overloaded :(`,
ERROR_USER_NOT_FOUND: `Sorry, that user doesn't exist :(`,
ERROR_UNKNOWN: `Unknown error occurred, sorry about that :(`,

Expand Down

0 comments on commit 34ed25b

Please sign in to comment.