mastodon: fix exception when fetching data for deleted posts.

Fix a `OAuth2::Error: Record not found` exception when trying to fetch
source data for a deleted Pawoo or Baraag post.
This commit is contained in:
evazion
2022-10-30 16:39:16 -05:00
parent c76e0bd4c1
commit 3846584540

View File

@@ -15,7 +15,7 @@ class MastodonApiClient
def json
return {} if id.blank? || access_token.blank?
JSON.parse(access_token.get("/api/v1/statuses/#{id}").body)
rescue JSON::ParserError
rescue
{}
end