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:
@@ -15,7 +15,7 @@ class MastodonApiClient
|
|||||||
def json
|
def json
|
||||||
return {} if id.blank? || access_token.blank?
|
return {} if id.blank? || access_token.blank?
|
||||||
JSON.parse(access_token.get("/api/v1/statuses/#{id}").body)
|
JSON.parse(access_token.get("/api/v1/statuses/#{id}").body)
|
||||||
rescue JSON::ParserError
|
rescue
|
||||||
{}
|
{}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user